17 lines
238 B
Go
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()
|
|
}
|