GlazeWM#
import Yasb
GlazeWM workspaces (with window icons), tiling direction and binding modes, with functions to switch them. Connects to GlazeWM's IPC server. While GlazeWM isn't running, YASB retries every 4 seconds and the data is empty. Objects of the same type that use the same server share one connection.
Three types, all with serverUri and connected:
- GlazewmWorkspaceList: workspaces.
- GlazewmTiling: tiling direction.
- GlazewmBindingModes: active binding mode.
Common to all three#
Properties#
serverUri : string#
GlazeWM's IPC server.
Default: "ws://localhost:6123"
connected : bool read-only#
true when GlazeWM is running and YASB is connected.
GlazewmWorkspaceList#
Properties#
screenName : string#
Name of the screen the widget is on. Set it to bar.screenName. Empty means the primary screen.
Default: ""
monitorExclusive : bool#
When true, workspaces holds only the workspaces of screenName's monitor. When false, all monitors.
Default: true
appIcons : object#
Which workspaces list their windows' icons in icons. All keys are optional:
enabledPopulated: bool, workspaces with windows. Defaultfalse.enabledActive: bool, the workspace shown on the screen. Defaultfalse.enabledFocused: bool, the focused workspace. If not set,enabledActiveis used.maxIcons: int, maximum icons per workspace.0means no limit. Default0.hideFloating: bool, skip floating windows. Defaultfalse.hideDuplicates: bool, one icon per app. Defaultfalse.
Default: {}
workspaces : list read-only#
Workspaces, sorted by name (numbers in numeric order). Each is an object:
name: string, workspace name. Used byactivateWorkspace().displayName: string, display name.""when GlazeWM gives none.focused: bool,truefor the focused workspace.displayed: bool,truewhen shown on its monitor.windowCount: int, number of windows.-
status: string,emptyorpopulated, prefixed withfocused_for the focused workspace, oractive_for the one shown on the screen withmonitorExclusive. For examplefocused_populated. -
icons: list, window icons as chosen byappIcons, each{hwnd, title, source}: window handle, title, and image URL of the icon.
Functions#
activateWorkspace(name: string)#
Focuses the workspace with this name.
switchWorkspace(direction: int)#
direction above 0 (scroll up): previous workspace. Below 0: next workspace. It cycles through GlazeWM's active
workspaces on screenName's monitor when monitorExclusive is set, or on all monitors otherwise.
GlazewmTiling#
Properties#
direction : string read-only#
Tiling direction of the focused container: horizontal or vertical. "" while not connected.
Functions#
toggleTilingDirection()#
Switches the focused container between horizontal and vertical.
GlazewmBindingModes#
Properties#
name : string read-only#
Name of the active binding mode. "" when none is active or while not connected.
displayName : string read-only#
Display name, or name when GlazeWM gives none.
active : bool read-only#
true when a binding mode is active.
Functions#
enableBindingMode(name: string)#
Turns on the binding mode with this name.
disableBindingMode()#
Turns off the active binding mode.
Used by#
YASB's own GlazeWM workspaces widget uses GlazewmWorkspaceList, listed in Widgets. No YASB widget uses GlazewmTiling or GlazewmBindingModes.