Execute function implemented
This commit is contained in:
parent
600fe1aaa5
commit
e4ea87582a
21
execute_command.go
Normal file
21
execute_command.go
Normal file
@ -0,0 +1,21 @@
|
||||
package hypr
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
)
|
||||
|
||||
func Execute(cmd string) error {
|
||||
conn, err := net.Dial("unix", os.ExpandEnv("/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
if _, err := fmt.Fprintln(conn, cmd); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
Loading…
Reference in New Issue
Block a user