jD91mZM2 / xidlehook

GitLab: https://gitlab.com/jD91mZM2/xidlehook
MIT License
387 stars 33 forks source link

`--killer` feature from xautolock #8

Closed Ronnie76er closed 6 years ago

Ronnie76er commented 6 years ago

Just to comment on what the killer feature is from xautolock, it's meant to just run a second timer for a second command...even though the name is not great. So, for instance, I used to have it so that my computer would lock after 5 minutes and then suspend after an hour:

xautolock -time 5 -locker i3lock -corners +000 -cornerdelay 1 -killer "systemctl suspend" -killtime 60

In the case of xidlehook, there's no need for this functionality. As you can run more than one xidlehook, I personally am simply running one that does the locking and one that does the suspending:

(From my i3/config file)

exec --no-startup-id xidlehook \
  --time 5 \
  --timer 'xrandr --output DVI-I-1 --brightness 1 --output DP-0 --brightness 1; i3lock' \
  --notify 10 \
  --notifier  'xrandr --output DVI-I-1 --brightness .1 --output DP-0 --brightness .1' \
  --canceller 'xrandr --output DVI-I-1 --brightness 1 --output DP-0 --brightness 1' \
  --not-when-fullscreen \
  --not-when-audio
exec --no-startup-id xidlehook \
  --time 60 \
  --timer 'xrandr --output DVI-I-1 --brightness 1 --output DP-0 --brightness 1; systemctl suspend' 
jD91mZM2 commented 6 years ago

Thank you! This might be worth adding to avoid some overhead of running two instances

jD91mZM2 commented 6 years ago

Fixed in f73c81827d06394f3fad809c1300cf0fdf5c314c :smile:

Ronnie76er commented 6 years ago

Nice! Glad I could help!