sway/run_command.go
2023-10-07 16:53:14 +02:00

17 lines
238 B
Go

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()
}