RunCommand implemented

This commit is contained in:
milarin 2023-10-07 16:53:14 +02:00
parent 5a556ec6c9
commit 041e3540e8

16
run_command.go Normal file
View File

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