Skip to main content

Signals Reference

SomeWM uses signals for event-driven programming. Connect to signals to react to changes.

Client Signals

SignalArgumentsDescription
managecNew client appeared
unmanagecClient closed
focuscClient gained focus
unfocuscClient lost focus
raisedcClient moved to top of stack (see Client Stacking)
loweredcClient moved to bottom of stack
property::namecTitle changed
property::classcClass changed
property::geometrycSize/position changed
property::floatingcFloating state changed
property::fullscreencFullscreen state changed
property::ontopcOntop layer state changed
property::abovecAbove layer state changed
property::belowcBelow layer state changed
property::urgentcUrgency changed
request::titlebarscClient requests titlebars

Screen Signals

SignalArgumentsDescription
addedsNew screen connected
removedsScreen disconnected
property::geometrysScreen geometry changed
property::workareasWorkarea changed
property::scalesOutput scale changed somewm-only
property::outputssOutput metadata changed

Tag Signals

SignalArgumentsDescription
property::selectedtTag selection changed
property::activatedtTag activated/deactivated
taggedt, cClient added to tag
untaggedt, cClient removed from tag

Layer Surface Signals somewm-only

SignalArgumentsDescription
request::managel, context, hintsLayer surface appeared
request::unmanagel, context, hintsLayer surface closing
request::keyboardl, context, hintsLayer surface wants keyboard
property::has_keyboard_focuslKeyboard focus changed

See layer_surface reference for details.

Global Signals

SignalDescription
startupSomeWM finished starting
exitSomeWM is shutting down
refreshBefore redraw

Example Usage

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

-- React to screen changes
screen.connect_signal("added", function(s)
-- Set up new screen
awful.tag({ "1", "2", "3" }, s, awful.layout.layouts[1])
end)

See Also