dotfiles/lock.sh
Cyryl Płotnicki 064ce12f19 adb + dpms off
2019-07-26 12:41:42 +01:00

15 lines
372 B
Bash
Executable file

#!/usr/bin/env bash
set -e
set -o pipefail
export PRIMARY_DISPLAY="$(xrandr | awk '/ primary/{print $1}')"
xset s off
xset -dpms
xidlehook \
--not-when-fullscreen \
--not-when-audio \
--timer normal 180 'xrandr --output "$PRIMARY_DISPLAY" --brightness .1' 'xrandr --output "$PRIMARY_DISPLAY" --brightness 1' \
--timer normal 600 'systemctl suspend' ''