Skip to main content

wibox

The wibox library provides the widget system for AwesomeWM/SomeWM. It includes primitive widgets, containers, layouts, and the wibar (status bar).

Upstream documentation: awesomewm.org/apidoc/popups_and_bars/wibox.html

Widget Types

Widgets come in three categories: primitives that display content, containers that modify a single widget, and layouts that arrange multiple widgets.

Primitives

WidgetPurpose
wibox.widget.textboxDisplay text with optional markup
wibox.widget.imageboxDisplay images and icons
wibox.widget.progressbarHorizontal or vertical progress bars
wibox.widget.sliderDraggable slider controls
wibox.widget.checkboxCheckboxes and toggle indicators
wibox.widget.graphLine/bar graphs for time series data
wibox.widget.systraySystem tray (SNI on Wayland)
wibox.widget.separatorVisual separator between widgets
wibox.widget.calendarCalendar display

Containers

Containers wrap a single child widget to modify its appearance or size.

ContainerEffect
wibox.container.backgroundAdd background colour, foreground colour, shape, border
wibox.container.marginAdd padding around a widget
wibox.container.constraintSet minimum/maximum size
wibox.container.placeAlign widget within available space (centre, left, etc.)
wibox.container.rotateRotate content (90, 180, 270 degrees)
wibox.container.mirrorFlip content horizontally or vertically
wibox.container.scrollScroll content that overflows
wibox.container.radialprogressbarCircular progress indicator around a widget
wibox.container.arcchartArc-shaped chart around a widget

Layouts

Layouts arrange multiple child widgets.

LayoutArrangement
wibox.layout.fixed.horizontalSide by side, each widget at its natural size
wibox.layout.fixed.verticalStacked vertically, each widget at its natural size
wibox.layout.flex.horizontalSide by side, all widgets equal width
wibox.layout.flex.verticalStacked vertically, all widgets equal height
wibox.layout.align.horizontalThree sections: left, centre, right
wibox.layout.align.verticalThree sections: top, centre, bottom
wibox.layout.stackAll children occupy the same space (overlapping)
wibox.layout.gridGrid with rows and columns
wibox.layout.ratio.horizontalSide by side, proportional widths
wibox.layout.ratio.verticalStacked vertically, proportional heights
wibox.layout.manualAbsolute positioning

Widget Composition

Widgets compose by nesting. The widget field identifies the type, and children are table entries:

wibox.widget {
{
{
text = "Hello",
widget = wibox.widget.textbox,
},
margins = 8,
widget = wibox.container.margin,
},
bg = "#333333",
shape = gears.shape.rounded_rect,
widget = wibox.container.background,
}

Use id fields to access nested widgets later:

local w = wibox.widget {
{
id = "my_text",
text = "",
widget = wibox.widget.textbox,
},
widget = wibox.container.margin,
}

w:get_children_by_id("my_text")[1].text = "Updated"

References

ReferenceDescription
Wibar PropertiesWibar positioning and configuration

Behavioral Notes

SomeWM uses the SNI (StatusNotifierItem) protocol for the system tray instead of X11's XEmbed. See Wayland vs X11 for details.