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

PropTypeDefaultDescription
position"top" | "bottom" | "left" | "right""top"Screen edge to dock along (auto-sets layer-shell anchors)
gapCssSize8Pixel spacing between children inside each slot
leftComponent | Component[]nilComponent(s) anchored to the start slot
centerComponent | Component[]nilComponent(s) centered cleanly in the middle slot
rightComponent | Component[]nilComponent(s) anchored to the end slot
autohideboolean | BarAutohideOptionsfalseCollapses 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 uses left/center/right, you never fight Lua's reserved end keyword.

BarAutohideOptions

KeyTypeDescription
triggerSizeintegerThickness of the edge trigger hotspot in pixels
pressurenumberEdge pressure threshold pushed against the monitor wall (0 = instant on enter)
pressureDecayintegerMilliseconds of inactivity before pressure resets
hideDelayintegerMilliseconds to wait after pointer leaves before hiding
durationintegerReveal/collapse animation duration in ms
startHiddenbooleanStart collapsed on launch

Methods

MethodDescription
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 {}
	}
}