Configuration
The sweetidle config file
sweetidle reads ~/.config/sweetidle/config.toml, or another file with
--config <path>. The file is required.
[general]
lock_command = "veila lock --wait-ready"
before_sleep_command = "veila lock --wait-ready"
after_resume_command = "sweets msg output-power '*' on"
[[listener]]
timeout = 300
on_timeout = "veila lock --wait-ready"
ignore_inhibit = true
[[listener]]
timeout = 600
on_timeout = "sweets msg output-power '*' off"
on_resume = "sweets msg output-power '*' on"Check it, then apply it with sweetidle reload:
sweetidle --check-configUnknown keys, bad timeouts, and empty commands are errors.
Examples
Lock after 5 minutes
[[listener]]
timeout = 300
on_timeout = "veila lock --wait-ready"
ignore_inhibit = true # lock even while a video playsTurn off displays after 10 minutes
[[listener]]
timeout = 600
on_timeout = "sweets msg output-power '*' off"
on_resume = "sweets msg output-power '*' on"Lock before suspend
[general]
before_sleep_command = "veila lock --wait-ready"
after_resume_command = "sweets msg output-power '*' on"
wait_before_sleep = trueUse a locker that returns only after the screen is locked. On FreeBSD this needs the rc hook.
Handle loginctl lock-session
Linux only.
[general]
lock_command = "veila lock --wait-ready"[general]
All keys are optional.
| Key | Default | Description |
|---|---|---|
lock_command | unset | Run on a logind lock request. Linux only |
unlock_command | unset | Run on a logind unlock request. Linux only |
before_sleep_command | unset | Run before suspend |
after_resume_command | unset | Run after resume |
wait_before_sleep | true | Hold suspend until the before-sleep command exits (logind max delay on Linux, 4 s on FreeBSD) |
ignore_dbus_inhibit | false | Ignore ScreenSaver D-Bus inhibitors |
ignore_systemd_inhibit | false | Ignore systemd-logind inhibitors. No effect on FreeBSD |
Only set unlock_command if your locker has a safe unlock command.
[[listener]]
One table per timeout.
| Key | Default | Description |
|---|---|---|
timeout | required | Idle seconds, 1 to 4294967 |
on_timeout | unset | Run when the timeout expires |
on_resume | unset | Run on activity, only if on_timeout fired |
ignore_inhibit | false | Run despite all inhibitors. Needs ext_idle_notifier_v1 v2 |
[idle_hint]
Linux only.
| Key | Default | Description |
|---|---|---|
timeout | required | Idle seconds before the session is reported idle to logind |
Commands
Commands run through sh -c with sweetidle's PATH. stdout is discarded,
stderr goes to sweetidle's log. Stopping sweetidle leaves running commands
alive.
Inhibitors
| Source | Example | Opt out |
|---|---|---|
| Compositor | A Sweets idle_inhibit rule | ignore_inhibit per listener |
| D-Bus | A browser playing video | ignore_dbus_inhibit = true |
| systemd (Linux) | systemd-inhibit --what=idle | ignore_systemd_inhibit = true |
sweetidle status lists D-Bus and systemd inhibitors. Compositor inhibitors
are not visible to clients.