Skip to main content

Wibar Properties

Reference for awful.wibar configuration options.

Basic Properties

PropertyTypeDefaultDescription
positionstring"top"Bar position: "top", "bottom", "left", "right"
screenscreen-Screen to attach the wibar to
heightnumber-Bar height (for top/bottom bars)
widthnumber-Bar width (for left/right bars)
visiblebooleantrueWhether the wibar is visible

Appearance

PropertyTypeDefaultDescription
bgcolorbeautiful.wibar_bgBackground color
fgcolorbeautiful.wibar_fgForeground/text color
opacitynumber1Opacity (0.0 to 1.0)
shapefunction-Shape function (e.g., gears.shape.rounded_rect)

Borders

PropertyTypeDefaultDescription
border_widthnumber0Border width in pixels
border_colorcolor-Border color

Margins

PropertyTypeDefaultDescription
marginstable/number0Margins around the wibar

Margins can be a number (all sides) or a table:

margins = {
top = 8,
bottom = 0,
left = 8,
right = 8,
}

Content

PropertyTypeDefaultDescription
widgetwidget-The widget tree to display

Examples

Basic Wibar

awful.wibar {
position = "top",
screen = s,
widget = {
layout = wibox.layout.align.horizontal,
{ -- Left
layout = wibox.layout.fixed.horizontal,
s.mytaglist,
},
s.mytasklist, -- Center
{ -- Right
layout = wibox.layout.fixed.horizontal,
wibox.widget.textclock(),
},
},
}

Floating Wibar

awful.wibar {
position = "top",
screen = s,
height = 32,
margins = {
top = 8,
left = 8,
right = 8,
},
shape = function(cr, w, h)
gears.shape.rounded_rect(cr, w, h, 8)
end,
}

Transparent Wibar

awful.wibar {
position = "top",
screen = s,
bg = beautiful.wibar_bg .. "cc", -- Add alpha
border_width = 1,
border_color = beautiful.border_color_normal,
}

Vertical Sidebar

awful.wibar {
position = "left",
screen = s,
width = 48,
widget = {
layout = wibox.layout.align.vertical,
{ -- Top
layout = wibox.layout.fixed.vertical,
s.mytaglist,
},
nil, -- Middle (empty)
{ -- Bottom
layout = wibox.layout.fixed.vertical,
s.mylayoutbox,
},
},
}

Controlling Visibility

-- Toggle wibar
s.mywibox.visible = not s.mywibox.visible

-- Keybinding to toggle
awful.key({ modkey }, "b", function()
local s = awful.screen.focused()
s.mywibox.visible = not s.mywibox.visible
end)

Theme Variables

These beautiful variables provide defaults for wibars:

VariableDescription
wibar_bgDefault background
wibar_fgDefault foreground
wibar_heightDefault height
wibar_border_colorDefault border color
wibar_border_widthDefault border width

See Also