dotfiles/lock.sh

16 lines
472 B
Bash
Raw Normal View History

2019-07-15 20:52:19 +01:00
#!/usr/bin/env bash
2019-07-26 12:41:26 +01:00
set -e
set -o pipefail
2019-07-15 20:52:19 +01:00
export PRIMARY_DISPLAY="$(xrandr | awk '/ primary/{print $1}')"
2019-07-26 12:41:26 +01:00
xset s off
xset -dpms
2019-07-15 20:52:19 +01:00
xidlehook \
--not-when-fullscreen \
--not-when-audio \
--timer normal 120 'xrandr --output "$PRIMARY_DISPLAY" --brightness .1' 'xrandr --output "$PRIMARY_DISPLAY" --brightness 1' \
--timer normal 300 'xrandr --output "$PRIMARY_DISPLAY" --brightness 1; systemctl suspend' 'xrandr --output "$PRIMARY_DISPLAY" --brightness 1'
2019-07-18 21:29:18 +01:00