diff --git a/run_command.go b/run_command.go new file mode 100644 index 0000000..769f33e --- /dev/null +++ b/run_command.go @@ -0,0 +1,16 @@ +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() +}