AwesomeWM Config

This AwesomeWM setup is the orchestration layer for LinuxUtilities. It binds keys, builds the status widgets, launches helper tools, and connects desktop events to the rest of the toolkit.

⌨
Current layout: rc.lua is the entry point and reusable logic now lives under linuxutils/*.lua. When you install the config, copy both the entrypoint and the module tree.

Installation

# Recommended: install the full user config tree from the repo
cd ~/Workspace/LinuxUtilities
make awesome-user-update

# Or update the system-wide config tree (uses sudo)
make awesome-update

# Reload AwesomeWM (no restart needed)
# Press Mod4+Ctrl+r  or:
awesome-client 'awesome.restart()'

The update targets install:

Config Tree

PathRole
rc.luaAwesomeWM entrypoint. Loads Awesome libraries, updates package.path, imports local modules, defines widgets, key bindings, rules, and signals.
linuxutils/common.luaShared helper functions used by the config: shell quoting, hostname lookup, command existence checks, compact label helpers, numeric clamping.
linuxutils/brightness.luaBrightness controller with backend fallbacks: brightnessctl, light, xbacklight, writable /sys/class/backlight/*, then xrandr.
linuxutils/icons.luaSemantic icon/palette helpers for status widgets. Produces Pango markup so Bluetooth and network indicators stay visible on the dark bar.
linuxutils/audio.luaAudio controller for volume changes, mute, media keys, notifications, PipeWire/PulseAudio refresh, and audio widget tooltip text.
linuxutils/presenter.luaPresenter controller for cursor spotlight, Gromit overlay commands, and the animated presenter dash helper script.
linuxutils/launchers.luaLauncher/controller actions for flameshot, the rofi program palette, Linux Control Center, system utilities, folder navigation, AppImage scanning/launching, notes entrypoints, and the btop -> htop -> top system monitor fallback chain.
linuxutils/calendar.luaCalendar popup controller. Builds the larger center-screen agenda panel, month navigation, font-size controls, and daily-note preview/actions.
linuxutils/widgets.luaWidget factory/controller for audio, battery, network, Bluetooth, system usage, Thunderbird, and clock widgets. Network, Bluetooth, and audio refresh from device events with a conservative periodic fallback.
linuxutils/device_events.luaConsumes LinuxUtilities session D-Bus events and debounces focused widget refreshes.
linuxutils/bindings.luaBinding factory for root mouse buttons, global media/presenter/launcher hotkeys, client keys, and client-side utility mouse actions.
icons/LinuxUtilitiesStatus/Bundled GTK icon theme overrides for tray applets so Bluetooth and Wi-Fi indicators can use explicit colors instead of inheriting Mint's dark symbolic glyphs.

How The Modules Stitch Together

rc.lua
  -> resolve_config_dir()
  -> package.path += "<config dir>/?"
  -> require("linuxutils.common")
  -> require("linuxutils.brightness")
  -> require("linuxutils.audio")
  -> require("linuxutils.presenter")
  -> require("linuxutils.launchers")
  -> require("linuxutils.calendar")
  -> require("linuxutils.widgets")
     -> require("linuxutils.icons")
  -> require("linuxutils.bindings")
  -> construct controllers
  -> construct binding tables
  -> alias public actions for keybindings/mouse bindings
  -> build the wibar using widgets.lua
  -> install root/global/client bindings from bindings.lua

rc.lua now behaves like a composition root. The modules own the logic; the entrypoint owns wiring, layouts, bindings, and AwesomeWM lifecycle hooks.

Right-click Menu

The root right-click menu uses freedesktop.menu.build() when the freedesktop helper is available. That means installed applications are discovered from desktop-entry files under the standard XDG application directories, not from a hardcoded Lua list.

On top of that generated app menu, this config now injects a custom LinuxUtilities submenu with notes, files, AppImage launching, system monitor, network actions, world clock, and timezone actions. If you want more items in the application list itself, install or edit .desktop files; if you want workflow actions, add them to the custom submenu in rc.lua.

Multi-screen behavior

Clock / calendar behavior

System Stack

AwesomeWM is a user-space window manager. It does not talk directly to the Linux kernel to arrange windows. Instead, it receives events from the X server and calls out to user-space tools and daemons when it needs information or device changes.

Diagram of the AwesomeWM stack from Linux kernel and hardware up through X11, AwesomeWM, rc.lua modules, widgets, and helper commands

What talks to what

  • Keyboard and device interrupts start in the kernel and input stack.
  • Xorg/X11 exposes those events to AwesomeWM.
  • awful.key callbacks in rc.lua turn those events into Lua actions.
  • Those actions may call helper commands like pactl, xrandr, nmcli, brightnessctl, or flameshot.

What this config adds

  • Media keys and brightness handling
  • Presenter controls for Gromit, spotlight, and dash drawing
  • Status widgets for audio, battery, network, Bluetooth, mail, and clock
  • A compact CPU/RAM widget that opens the preferred process monitor
  • Folder and AppImage launch widgets for daily desktop tasks
  • Workflow launchers for the Linux control center and presentation tools

Example Event Flow

Brightness key example

  1. You press a laptop brightness key.
  2. X11 delivers an XF86MonBrightness* key event to AwesomeWM.
  3. rc.lua dispatches to linuxutils/brightness.lua.
  4. The brightness module tries hardware-friendly tools first, then falls back to xrandr software dimming if needed.
  5. A notification shows which backend actually handled the change.

How Module Loading Works

rc.lua first resolves the directory it was loaded from, then prepends that path to Lua's package.path. That matters because the same config must work both from the repository checkout and after installation into ~/.config/awesome or /etc/xdg/awesome.

local config_dir = resolve_config_dir()
package.path = table.concat({
    config_dir .. "?.lua",
    config_dir .. "?/init.lua",
    package.path,
}, ";")

local common = require("linuxutils.common")
local brightness = require("linuxutils.brightness")
local audio = require("linuxutils.audio")
local presenter = require("linuxutils.presenter")
local launchers = require("linuxutils.launchers")
local widgets = require("linuxutils.widgets")
local bindings = require("linuxutils.bindings")

After the local module requires, rc.lua constructs controllers and aliases their public methods into the names used later by keybindings and widget setup.

local audio_controller = audio.new({ ... })
local presenter_controller = presenter.new({ ... })
local launchers_controller = launchers.new({ ... })
local widgets_controller = widgets.new({ ... })
local binding_tables = bindings.build({ ... })

local volume_up = audio_controller.volume_up
local open_flameshot = launchers_controller.open_flameshot
local create_audio_widget = widgets_controller.create_audio_widget
root.buttons(binding_tables.root_buttons)

This keeps the entrypoint small enough to reason about while still letting the config ship as a self-contained tree.

How To Edit This Config Safely

Edit, test, deploy, reload, and recover workflow for the AwesomeWM config
# 1. Edit the repo copy
$EDITOR rc.lua
$EDITOR linuxutils/common.lua
$EDITOR linuxutils/brightness.lua
$EDITOR linuxutils/icons.lua
$EDITOR linuxutils/audio.lua
$EDITOR linuxutils/presenter.lua
$EDITOR linuxutils/launchers.lua
$EDITOR linuxutils/widgets.lua
$EDITOR linuxutils/bindings.lua

# 2. Validate before install
make awesome-test
awesome -k -c rc.lua

# 3. Install into your user config tree
make awesome-user-update

# 4. Reload AwesomeWM
# Mod4 + Ctrl + r

Writing AwesomeWM Lua

Common Awesome building blocks

  • awful.key for key bindings
  • awful.spawn and awful.spawn.easy_async_with_shell for external commands
  • naughty.notify for notifications
  • gears.timer for delayed refresh/retry behavior
  • wibox.widget for bar widgets and controls

Style of Lua used here

  • Keep shared logic in small modules that return tables.
  • Keep desktop actions as explicit local functions instead of anonymous shell blobs sprinkled everywhere.
  • Prefer one config entrypoint and small reusable modules over multiple competing rc.lua copies.
  • Validate with awesome -k before reloading.
local function volume_up()
    awful.spawn({ "pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%" }, false)
end

awful.key({}, "XF86AudioRaiseVolume", volume_up,
    { description = "increase volume", group = "media" })

Hotkey Groups

All custom keybindings are organized into AwesomeWM's built-in help system (Mod4+s).

Launcher

KeyAction
Mod4+ReturnOpen terminal
Mod4+rRun prompt
Mod4+pApplication menu (rofi)
Mod4+cControl Center
Mod4+spaceCursor Spotlight

Window Management

KeyAction
Mod4+j/kFocus next/previous client
Mod4+Shift+j/kSwap client position
Mod4+l/hIncrease/decrease master width
Mod4+mToggle maximize
Mod4+fToggle fullscreen
Mod4+Shift+cClose client

Drawing & Presentation

KeyAction
F6Toggle Gromit drawing
Shift+F6Clear Gromit strokes
Alt+F11Set presenter anchor
F11Draw dash segment
Shift+F11Draw dotted segment
Ctrl+F11Draw solid segment
Mod4+F11Draw arrow segment

Tags (Workspaces)

KeyAction
Mod4+1-9Switch to tag 1–9
Mod4+Shift+1-9Move client to tag
Mod4+Ctrl+1-9Toggle tag visibility

Widgets + Status Bar

The wibar is assembled in rc.lua and combines standard Awesome widgets with LinuxUtilities-specific status blocks. The right side hosts Bluetooth, network, CPU/RAM, battery, audio, keyboard layout, systray, application launcher, folder launcher, host label, Thunderbird, clock, and layout indicators.

The network and Bluetooth widgets now render through linuxutils/icons.lua using light-colored Pango markup and are the primary status indicators by default. The tray applets are optional: if you set LINUXUTILS_AUTOSTART_STATUS_APPLETS=1 before starting AwesomeWM, nm-applet and blueman-applet are relaunched with GTK_ICON_THEME=LinuxUtilitiesStatus, Blueman is pushed to full-color mode by setting org.blueman.general symbolic-status-icons to false, and the bundled tray icon theme under icons/LinuxUtilitiesStatus/ overrides the icon names those applets request.

Mod4+Space opens the universal LinuxUtilities surface: one fuzzy search across LinuxUtilities actions, folders, desktop applications, open windows, and shell commands. Mod4+r remains an alias. The folder widget still prefers yazi, then ranger, then lf, and finally xdg-open or gio. Mod4+/ remains the focused folder-only surface, with Enter to open, Ctrl+O for a terminal, and Alt+C to copy the path. Layout cycling now uses Mod4+Alt+Space and Mod4+Alt+Shift+Space. The network widget exposes nmtui-connect directly inside x-terminal-emulator, and the right-click menu mirrors that path under LinuxUtilities -> network -> Wi-Fi picker (nmtui).

┌──────────────────────────────── Wibar ────────────────────────────────────────┐ │ [taglist] [tasklist] [utilities] [systray] [clock]│ └───────────────────────────────────────────────────────────────────────────────┘ │ ▼ ┌─── Utilities Widget ───┐ │ │ │ 🌙 Night Light: ON │ │ ✏️ Gromit: OFF │ │ 🎯 Spotlight: IDLE │ │ │ │ Click → Control Center│ └────────────────────────┘

Theme Integration

The config applies a dark theme consistent with the Antsand brand:

ElementColorValue
Background████#232323
Foreground████#e0e0e0
Accent (focus)████#c4a7ff
Urgent████#e74c3c
Active tag████#07adf8

Theme file location: ~/.config/awesome/themes/antsand/theme.lua

Testing

# AwesomeWM-only checks
make awesome-test

# Full fast test path used by the git pre-commit hook
make test-fast

# Build docs after changing this page
bash docs/build.sh

make awesome-test currently validates:

The runtime smoke wrapper skips cleanly when a usable virtual X11 display is not available in the current shell.

Crash Recovery

If AwesomeWM crashes or fails to load the config:

  1. Press Ctrl+Alt+F2 to switch to a TTY
  2. Log in and check syntax: awesome -k -c ~/.config/awesome/rc.lua
  3. Restore the matching backup of rc.lua and, if needed, the matching linuxutils/ backup directory created by the Make targets.
  4. Press Ctrl+Alt+F7 to return to the graphical session
  5. Reload: awesome-client 'awesome.restart()'

Alternatively, the rescue-windows.sh script can recover floating windows if layouts break.