swayidle
Idle management daemon for Sway
TLDR
Lock screen on idle
SYNOPSIS
swayidle [options] [events]
DESCRIPTION
swayidle is an idle management daemon for the Sway Wayland compositor that triggers commands based on user inactivity. It supports multiple timeout events that execute commands after specified periods of idle time, enabling staged power management such as dimming the screen, locking, and eventually suspending.
Resume actions execute when user activity is detected after a timeout, allowing reversal of timeout effects like turning displays back on. The before-sleep and after-resume events integrate with systemd sleep/wake cycles, commonly used to ensure the screen is locked before the system suspends.
Lock and unlock events respond to session lock signals from logind, enabling coordination with external lock requests such as those from the system settings or other applications.
PARAMETERS
timeout SECONDS COMMAND
Run after idle time.resume COMMAND
Run on activity.before-sleep COMMAND
Run before suspend.after-resume COMMAND
Run after wake.lock COMMAND
Run on lock event.unlock COMMAND
Run on unlock.-w
Wait for command.
CAVEATS
Wayland/Sway only. Commands run as shell. Audio may prevent idle.
HISTORY
swayidle is the idle manager for Sway compositor. It handles power management and screen locking triggers.
