From d617a7dde7993dcb9f52fc037e3f648e37157676 Mon Sep 17 00:00:00 2001 From: milarin Date: Wed, 14 Feb 2024 16:51:23 +0100 Subject: [PATCH] GetSeats implemented --- get_seats.go | 5 +++++ types.go | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 get_seats.go 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) +}