26 lines
503 B
Go
26 lines
503 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("/tmp/hypr/%s/.socket.sock", c.Signature)
|
|
}
|
|
|
|
func (c Client) EventSocketPath() string {
|
|
return fmt.Sprintf("/tmp/hypr/%s/.socket2.sock", c.Signature)
|
|
}
|