2024-02-09 20:24:48 +01:00
|
|
|
package hypr
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2024-02-15 14:41:37 +01:00
|
|
|
func (i *Client) GetActiveWindow() (*Window, error) {
|
2024-02-09 20:24:48 +01:00
|
|
|
return readSocket[*Window](i.SocketPath(), strings.NewReader("j/activewindow"))
|
|
|
|
}
|
|
|
|
|
2024-02-15 14:41:37 +01:00
|
|
|
func (i *Client) GetActiveWorkspace() (*Workspace, error) {
|
2024-02-09 20:24:48 +01:00
|
|
|
return readSocket[*Workspace](i.SocketPath(), strings.NewReader("j/activeworkspace"))
|
|
|
|
}
|
|
|
|
|
2024-02-15 14:41:37 +01:00
|
|
|
func (i *Client) GetBinds() ([]*Bind, error) {
|
2024-02-09 20:24:48 +01:00
|
|
|
return readSocket[[]*Bind](i.SocketPath(), strings.NewReader("j/binds"))
|
|
|
|
}
|
|
|
|
|
2024-02-15 14:41:37 +01:00
|
|
|
func (i *Client) GetWindows() ([]*Window, error) {
|
2024-02-09 20:24:48 +01:00
|
|
|
return readSocket[[]*Window](i.SocketPath(), strings.NewReader("j/clients"))
|
|
|
|
}
|
|
|
|
|
2024-02-15 14:41:37 +01:00
|
|
|
func (i *Client) GetCursorPos() (Point, error) {
|
2024-02-09 20:24:48 +01:00
|
|
|
return readSocket[Point](i.SocketPath(), strings.NewReader("j/cursorpos"))
|
|
|
|
}
|
|
|
|
|
2024-02-15 14:41:37 +01:00
|
|
|
func (i *Client) GetMonitors() ([]*Monitor, error) {
|
2024-02-09 20:24:48 +01:00
|
|
|
return readSocket[[]*Monitor](i.SocketPath(), strings.NewReader("j/monitors"))
|
|
|
|
}
|
|
|
|
|
2024-02-15 14:41:37 +01:00
|
|
|
func (i *Client) GetWorkspaces() ([]*Workspace, error) {
|
2024-02-09 20:24:48 +01:00
|
|
|
return readSocket[[]*Workspace](i.SocketPath(), strings.NewReader("j/workspaces"))
|
|
|
|
}
|