Skip to main content
Version: 2.0 (dev)

Signals Reference

SomeWM is event-driven. The compositor and the AwesomeWM Lua libraries emit signals at lifecycle points; your rc.lua connects handlers to react. For the model behind signals (what they are, when C fires them, the request::* pattern, default handlers, ordering), see Signals (concepts).

This page is the lookup reference. Signals are grouped by the class or module that emits them.

Dispatch

C-emitted signals are queued and drained at some_refresh() in 2.0, not run inline with the Wayland event that triggered them. See Signals (concepts): Dispatch model for the model and the implications.

Currently queued:

  • Property: property::geometry, property::position, property::size, property::x, property::y, property::width, property::height, property::active
  • Focus: focus, unfocus, client::focus, client::unfocus
  • Mouse: mouse::enter, mouse::leave, mouse::move (coalesced per object)
  • Lifecycle: list, swapped
  • Request: request::activate, request::urgent, request::tag, request::select
  • Systray: request::secondary_activate, request::context_menu, request::scroll

All other C-emitted signals (and every Lua-emitted signal) dispatch synchronously today.

client signals

Emitted on the client class. Connect with client.connect_signal("name", handler) (no c argument: handlers receive whichever client the signal was emitted on).

Lifecycle

SignalArgsNotes
request::managec, context, hintsA new client wants to be managed. Default handlers (in awful.permissions, ruled.client) tag it, place it, and apply rules. Connect after default handlers run if you want to read post-rule properties.
managecThe client is now managed and tagged. Safe to read all properties.
request::unmanagec, context, hintsThe client is closing. Default handlers do final cleanup.
unmanagecThe client is gone. Don't access geometry or screen; they may already be invalid.
scanningnoneCompositor is enumerating already-running clients before any are managed. ruled.client emits request::rules from here.
scannednoneInitial scan is complete. Fires before awesome.startup callbacks.

Focus and stacking

SignalArgsNotes
focuscClient gained focus.
unfocuscClient lost focus. Fires before focus on the new client.
raisedcClient moved to top of its layer (see Client Stacking).
loweredcClient moved to bottom of its layer.

Properties

Each property::* fires after the property changes. Read the new value off the client.

SignalNotes
property::nameTitle changed.
property::classClass changed (rare; usually only at startup).
property::geometrySize or position changed.
property::floatingFloating state toggled.
property::fullscreenFullscreen toggled.
property::ontopAbove-everything layer toggled.
property::aboveAbove-normal layer toggled.
property::belowBelow-normal layer toggled.
property::urgentUrgency hint changed. Check c.urgent inside the handler; fires for both true and false.

Requests

request::* signals ask handlers to do something. The default handler usually lives in awful.permissions and ships with sensible defaults; replace it by disconnect_signal plus your own connect_signal. See Replacing a default handler.

SignalArgsNotes
request::activatec, context, hintsSomething asked for the client to become active (focused/raised). Default handler in awful.permissions.activate.
request::titlebarsc, context, hintsClient should grow titlebars. Connect to draw them (or skip drawing to opt out).
request::geometryc, context, hintsClient (or another module) asked to be moved/resized. context says why ("maximized_horizontal", "fullscreen", etc.).
request::tagc, tag, hintsClient needs a tag (after creation, after losing its screen). Default handler: awful.permissions.tag. hints.reason can be "screen", "screen-removed", "rules".
request::borderc, context, hintsClient wants its border restyled. Default handler: awful.permissions.update_border. context is one of "added", "active", "inactive", "floating", "urgent", "maximized", "fullscreen".
request::urgentcUrgency hint set. Fires alongside property::urgent.
request::default_keybindingscontext (string)Class signal emitted once at startup. Connect to register default keybindings via awful.keyboard.append_client_keybindings.
request::default_mousebindingscontext (string)Class signal emitted once at startup. Connect to register default mousebindings via awful.mouse.append_client_mousebindings.

screen signals

SignalArgsNotes
addedsNew output connected.
removedsOutput disconnected. Tags on this screen will get request::screen next.
request::desktop_decorationsScreen needs tags and wibars. Your handler creates them. See Tag Persistence.
request::wallpapersScreen wants its wallpaper drawn. Default consumers in gears.wallpaper.
property::geometrysScreen geometry changed (resolution or layout).
property::workareasWorkarea (geometry minus struts) changed. Fires when wibars appear or resize.
property::scalesOutput scale changed. somewm-only
property::outputssOutput metadata (model, make, refresh) changed.

tag signals

Connect with tag.connect_signal("name", handler). Handlers receive the tag.

SignalArgsNotes
request::screent, reasonTag's screen was removed and it needs a new one. Default handler: awful.permissions.tag_screen. See Tag Persistence.
request::default_layoutscontext (string)Class signal emitted once at startup. Connect to register layouts via awful.layout.append_default_layouts.
property::selectedtTag was selected or deselected.
property::activatedtTag was added to or removed from a screen.
taggedt, cClient added to tag.
untaggedt, cClient removed from tag.

ruled.client signals

Module-level signals on ruled.client. Connect with ruled.client.connect_signal(...).

SignalArgsNotes
request::rulesnoneFires once on client.scanning, after all modules are loaded but before any client is managed. Append rules to ruled.client.rules here so every module gets a chance before client matching begins. See Defer startup with request::rules.

ruled.notification signals

Module-level signals on ruled.notification.

SignalArgsNotes
request::rulesnoneSame shape as ruled.client request::rules. Append entries to ruled.notification.rules.

naughty signals

SignalArgsNotes
addednA notification was created.
destroyedn, reasonA notification was destroyed. reason matches naughty.notification_closed_reason.*.
request::displaynNaughty wants this notification rendered. Connect a handler that builds a notification widget. See Notifications.
request::action_iconaAn action wants its icon resolved.

See the naughty reference for the full set.

Layer surface signals somewm-only

SignalArgsNotes
request::managel, context, hintsA layer-shell surface appeared.
request::unmanagel, context, hintsA layer-shell surface is closing.
request::keyboardl, context, hintsLayer surface wants keyboard interactivity.
property::has_keyboard_focuslKeyboard focus on the layer surface changed.

See layer_surface reference for context.

Lock signals somewm-only

SignalArgsNotes
lock::activatesource (string)Session locked. source identifies the locker ("swaylock", "loginctl", etc.).
lock::deactivatenoneSession unlocked.
lock::auth_failednonePassword authentication failed.

Idle signals somewm-only

SignalArgsNotes
idle::startnoneFirst idle timeout fired.
idle::stopnoneActivity detected after being idle.
property::idle_inhibitednoneCombined idle inhibition state changed.

DPMS signals somewm-only

SignalArgsNotes
dpms::offnoneAt least one display entered sleep.
dpms::onnoneAt least one display woke up.

See Lock, Idle, and DPMS reference.

awesome signals

Global signals on awesome.*. Connect with awesome.connect_signal(...).

SignalArgsNotes
startupnoneSomeWM finished starting. Fires after client.scanned. Safe to assume all default handlers are connected.
exitrestart (boolean)SomeWM is shutting down. restart is true if we're about to re-exec for a hot reload.
refreshnoneAbout to redraw. Avoid expensive work in this handler; it fires often.
debug::errormsgAn uncaught Lua error occurred. Default handler logs to stderr.
debug::deprecationmsg, argsA deprecated API was called.

Example usage

-- React to new clients
client.connect_signal("manage", function(c)
if c.floating then
awful.placement.centered(c)
end
end)

-- Add rules late, from a module
ruled.client.connect_signal("request::rules", function()
ruled.client.append_rule {
rule = { class = "Firefox" },
properties = { tag = screen.primary.tags[2] },
}
end)

-- Set default layouts at startup
tag.connect_signal("request::default_layouts", function()
awful.layout.append_default_layouts {
awful.layout.suit.tile,
awful.layout.suit.floating,
}
end)

See also