RunCommand implemented
This commit is contained in:
parent
5a556ec6c9
commit
041e3540e8
16
run_command.go
Normal file
16
run_command.go
Normal 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()
|
||||
}
|
Loading…
Reference in New Issue
Block a user