A poor drop-in Python replacement for xidlehook that monitors user idle time and executes commands.
It is barely usable, but works for my simple need.
(RIP: jD91mZM2)
--timer TIMEOUT ACTION CANCELLER- Add a timer with timeout (seconds), action command, and canceller command (use''for no canceller)--not-when-fullscreen- Don't run timers when any application is fullscreen--not-when-audio- Don't run timers when any application is playing audio--detect-sleep/--no-detect-sleep- Enable/disable system sleep detection (default: enabled)--once- Exit after running through the timer chain once--debug- Enable debug output
Lock screen after 10 minutes of inactivity:
yidlehook --timer 600 'i3lock' ''Dim screen after 1 minute, then lock after 2 more minutes, also reverts brigtness if user becomes active before locking:
yidlehook --timer 60 'xrandr --output eDP-1 --brightness .1' 'xrandr --output eDP-1 --brightness 1' --timer 120 'i3lock' ''