hypr/getters.go

34 lines
988 B
Go

package hypr
import (
"strings"
)
func (i *Client) GetActiveWindow() (*Window, error) {
return readSocket[*Window](i.SocketPath(), strings.NewReader("j/activewindow"))
}
func (i *Client) GetActiveWorkspace() (*Workspace, error) {
return readSocket[*Workspace](i.SocketPath(), strings.NewReader("j/activeworkspace"))
}
func (i *Client) GetBinds() ([]*Bind, error) {
return readSocket[[]*Bind](i.SocketPath(), strings.NewReader("j/binds"))
}
func (i *Client) GetWindows() ([]*Window, error) {
return readSocket[[]*Window](i.SocketPath(), strings.NewReader("j/clients"))
}
func (i *Client) GetCursorPos() (Point, error) {
return readSocket[Point](i.SocketPath(), strings.NewReader("j/cursorpos"))
}
func (i *Client) GetMonitors() ([]*Monitor, error) {
return readSocket[[]*Monitor](i.SocketPath(), strings.NewReader("j/monitors"))
}
func (i *Client) GetWorkspaces() ([]*Workspace, error) {
return readSocket[[]*Workspace](i.SocketPath(), strings.NewReader("j/workspaces"))
}