Surface
Extends LayerWindow (exclusive = true by default)
Bar
A standalone Wayland screen-edge panel with left, center, and right slots, exclusive-zone reservation, and optional autohide.
A standalone Wayland screen-edge panel with left, center, and right slots, automatic exclusive-zone reservation, and optional pressure-activated autohide.
Unlike GTK4 toolkits that force you to wrap a CenterBox inside a LayerWindow inside a Window (and pray you remembered exclusive = true), Bar owns its own GtkApplicationWindow + layer-shell surface directly. Drop it in render/ and you have a panel.
Extends: LayerWindow (exclusive = true by default).
Props
| Prop | Type | Default | Description |
|---|---|---|---|
position | "top" | "bottom" | "left" | "right" | "top" | Screen edge to dock along (auto-sets layer-shell anchors) |
gap | CssSize | 8 | Pixel spacing between children inside each slot |
left | Component | Component[] | nil | Component(s) anchored to the start slot |
center | Component | Component[] | nil | Component(s) centered cleanly in the middle slot |
right | Component | Component[] | nil | Component(s) anchored to the end slot |
autohide | boolean | BarAutohideOptions | false | Collapses the bar into an edge Hotspot and slides back on hover/pressure |
Tip: You can also assign slots via Slam-Wrapping:
{ slot = "center", Clock {} }— and because Shlua usesleft/center/right, you never fight Lua's reservedendkeyword.
BarAutohideOptions
| Key | Type | Description |
|---|---|---|
triggerSize | integer | Thickness of the edge trigger hotspot in pixels |
pressure | number | Edge pressure threshold pushed against the monitor wall (0 = instant on enter) |
pressureDecay | integer | Milliseconds of inactivity before pressure resets |
hideDelay | integer | Milliseconds to wait after pointer leaves before hiding |
duration | integer | Reveal/collapse animation duration in ms |
startHidden | boolean | Start collapsed on launch |
Methods
| Method | Description |
|---|---|
bar:Show() | Reveals the bar immediately (cancels pending hide timers) |
bar:Hide() | Collapses the bar smoothly unless pinned |
bar:Toggle() | Toggles revealed state |
bar:Pin( pinned ) | Locks or unlocks the bar in its revealed state |
bar:IsRevealed() | Returns true when currently revealed |
Example
Bar {
id = "main-bar",
position = "top",
spacing = 6,
autohide = { pressure = 120, hideDelay = 400 },
left = {
AppMenu {},
Workspaces { type = "pills" },
ActiveWindow {}
},
center = {
Clock { format = "%a %b %e %I:%M %p" }
},
right = {
Audio { type = "slider", revealOnHover = true },
Battery {},
Tray {},
PowerMenu {}
}
}