diff --git a/get_seats.go b/get_seats.go new file mode 100644 index 0000000..041aa13 --- /dev/null +++ b/get_seats.go @@ -0,0 +1,5 @@ +package sway + +func (c *Client) GetSeats() ([]Seat, error) { + return sendMessage[[]Seat](c, 101, "") +} diff --git a/types.go b/types.go index 0c40c47..8583819 100644 --- a/types.go +++ b/types.go @@ -379,3 +379,15 @@ type LibInput struct { Dwtp string `json:"dwtp"` CalibrationMatrix [6]float64 `json:"calibration_matrix"` } + +type Seat struct { + Name string `json:"name"` + Capabilities int `json:"capabilities"` + Focus NodeID `json:"focus"` + Devices []InputDevice `json:"devices"` +} + +func (s Seat) String() string { + data, _ := json.MarshalIndent(s, "", "\t") + return string(data) +}