sway/run_command.go

17 lines
238 B
Go
Raw Normal View History

2023-10-07 16:53:14 +02:00
package sway
import (
"context"
"os/exec"
)
func RunCommand(ctx context.Context, command string) error {
cmd := exec.CommandContext(ctx, "swaymsg", command)
if err := cmd.Start(); err != nil {
return err
}
return cmd.Wait()
}