swayidle(1)
π€ swayidle β the idle manager for Wayland, bestie π€
Okay so real talk: swayidle(1) is from the General Commands Manual, and it's basically the friend who watches you do nothing and then makes stuff happen. Iconic behavior, honestly.
β¨ NAME β¨
swayidle β Idle manager for Wayland. That's it. That's the whole job. She watches, she waits, she executes. π
π SYNOPSIS π
swayidle [options] [events...]
Short, sweet, and absolutely doing the most. π«Ά
πΈ OPTIONS πΈ
-C<path>β The config file to use, bestie. By default she checks these paths in this exact order:$XDG_CONFIG_HOME/swayidle/config, then$HOME/.swayidle/config. Config file entries are events (like the ones in the EVENTS section below, keep reading π). And here's the tea: specifying events in the config and as arguments is not mutually exclusive β you can do both, she doesn't mind. π-hβ Show the help message and quit. A little "hi, here's what I do, bye" moment. β¨-dβ Enable debug output. For when you need to see everything she's thinking. π-wβ Wait for the command to finish executing before continuing. Super helpful for making sure abefore-sleepcommand has actually finished before the system goes to sleep.
β οΈ Heads up: using this option causes swayidle to block until the command finishes. Like, fully blocking. Don't say I didn't warn you. π
-S<seat-name>β Specify which seat to use. By default, if no name is specified, an arbitrary seat will be picked instead. She's chill like that. πͺ
π¦ DESCRIPTION π¦
swayidle listens for idle activity on your Wayland compositor and executes tasks on various idle-related events. You can specify any number of events at the command line and in the config file. Any number. She's flexible. She's accommodating. She's literally the ideal roommate. π
π EVENTS π
Okay this is the fun part, pay attention π
timeout<timeout><timeout command>[resume<resume command>]β Execute the timeout command if there is no activity for<timeout>seconds.
And if you also specify resume <resume command>, the resume command will be run when there is activity again. So it's like a little round trip: you get idle, she fires the timeout command, you come back, she fires the resume command. Glow up on both ends. β¨
before-sleep<command>β If built with systemd support, executes the command before systemd puts the computer to sleep. π΄
β οΈ Real note though: this only delays sleeping up to the limit set inlogind.conf(5)by the optionInhibitDelayMaxSec. A command that hasn't finished by then will keep running after resuming from sleep. So like, don't put anything eternity-long in there and expect it to be respected. π
after-resume<command>β If built with systemd support, executes the command after logind signals that the computer resumed from sleep. Welcome back, queen. πlock<command>β If built with systemd support, executes the command when logind signals that the session should be locked. πunlock<command>β If built with systemd support, executes the command when logind signals that the session should be unlocked. πidlehint<timeout>β If built with systemd support, setIdleHintto indicate an idle logind/elogind session after<timeout>seconds. Bonus detail: adding anidlehintevent will also causeswayidleto callSetIdleHint(false)when run, on resume, unlock, etc. She's thorough like that. π§
Also, all commands are executed in a shell. Every single one. No exceptions. π
π₯ SIGNALS π₯
swayidle responds to the following signals:
SIGTERM,SIGINTβ Run all pending resume commands. When finished,swayidlewill terminate. A graceful exit, we love to see it. πΈSIGUSR1β Immediately enter idle state. No waiting, no buildup, just straight into it. Main character energy. π
β EXAMPLE β
swayidle -w \
timeout 300 'swaylock -f -c 000000' \
timeout 600 'swaymsg "output * power off"' \
resume 'swaymsg "output * power on"' \
before-sleep 'swaylock -f -c 000000'
So what's happening here? This will lock your screen after 300 seconds of inactivity, then turn off your displays after another 300 seconds, and turn your screens back on when resumed. It will also lock your screen before your computer goes to sleep. Whole routine, fully handled. π
And here's the little detail that matters: to make sure swayidle waits for swaylock to lock the screen before it releases the inhibition lock, the -w option is used in swayidle, and -f in swaylock. Both of them. Don't skip one. π
πΊ AUTHORS πΊ
Maintained by Drew DeVault <sir@cmpwn.com>, who is assisted by other open source contributors. For more information about swayidle development, see https://github.com/swaywm/swayidle. Shoutout to Drew and the whole crew, fr fr. π«Ά
π SEE ALSO π
sway(5) swaymsg(1) sway-input(5) sway-output(5) sway-bar(5) loginctl(1)
Go read those too, they're all part of the same little ecosystem π
Okay that's the whole page!! Version/date stamp says 2026-10-25, and yeah β this was the swayidle(1) page from the General Commands Manual. Now go set a timeout and take a nap, you've earned it. π€π
π¦ where this page comes from
- arch rolling: swayidle 1.9.1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms