A command-line app bringing caffeinate functionality to xidlehook.
Triggers are used to monitor for when caffeinate should exit (and allow
xidlehook
to resume).
- Timer
- PID-based monitoring
Quit actions are used in conjunction with triggers to perform a final action before caffeinate exits.
cargo install --git https://github.com/rschmukler/caffeinate
Start xidlehook with a socket argument:
xidlehook --timer primary 60 "xset dpms force off" --socket "/tmp/xidlehook.sock"
# Running indefinitely (exit with Ctrl-C)
caffeinate
# Running for an hour
caffeinate --timer 3600
# Running until a process exits, then shutdown down the machine
caffeinate --pid 1234 --quit=shutdown