hypr/model_instance.go

26 lines
523 B
Go

package hypr
import (
"encoding/json"
"fmt"
)
type Client struct {
Signature string `json:"instance"`
PID int `json:"pid"`
WaylandSocket string `json:"wl_socket"`
}
func (c Client) String() string {
data, _ := json.MarshalIndent(c, "", "\t")
return string(data)
}
func (c Client) SocketPath() string {
return fmt.Sprintf("/run/user/1000/hypr/%s/.socket.sock", c.Signature)
}
func (c Client) EventSocketPath() string {
return fmt.Sprintf("/run/user/1000/hypr/%s/.socket2.sock", c.Signature)
}