Documentation
¶
Overview ¶
Package mango is the MangoWM IPC client (wayle-mango): one-shot "dispatch <command>" requests and the "watch all-monitors" / "watch all-clients" streams, each line a full-state JSON frame. Mango is dwm-derived: every monitor carries a fixed set of tags.
Index ¶
Constants ¶
const SocketEnv = "MANGO_INSTANCE_SIGNATURE"
SocketEnv is constants.rs's SOCKET_PATH_ENV.
Variables ¶
var ErrNotRunning = errors.New("mango: MANGO_INSTANCE_SIGNATURE is not set")
ErrNotRunning is Error::MangoNotRunning.
Functions ¶
func KeyboardLayout ¶
KeyboardLayout is refresh_globals' keyboard_layout: the active monitor's layout; "" when no monitor is active or it reports none.
func SocketPath ¶
func SocketPath() string
SocketPath reads the socket path; empty when mango is not running.
Types ¶
type Client ¶
type Client struct {
ID uint32
Title string
HasTitle bool
AppID string
HasAppID bool
Monitor string
Tags []uint32
IsUrgent bool
IsFocused bool
}
Client is core/client.rs's Client; empty title/app id read as unset, as from_snapshot filters them.
type Monitor ¶
type Monitor struct {
Name string `json:"name"`
IsActive bool `json:"active"`
Tags []Tag `json:"tags"`
ActiveTags []uint32 `json:"active_tags"`
// KeyboardLayout is the active XKB layout; mango reports it on
// every monitor, empty when unknown.
KeyboardLayout string `json:"keyboardlayout"`
}
Monitor is core/monitor.rs's Monitor.
type RejectedError ¶
type RejectedError struct{ Message string }
RejectedError is Error::MangoRejected.
func (*RejectedError) Error ¶
func (e *RejectedError) Error() string
type Tag ¶
type Tag struct {
Index uint32 `json:"index"`
IsActive bool `json:"is_active"`
IsUrgent bool `json:"is_urgent"`
Layout string `json:"layout"`
ClientCount uint32 `json:"client_count"`
}
Tag is types.rs's Tag.
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher holds the latest monitor and client frames from the two watch streams and ticks after each applied frame.