dotfiles/nixos/i3/lock.sh
Cyryl Płotnicki 2689fafc4a Change to kitty
2020-10-15 23:09:30 +01:00

19 lines
432 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 60 \
'xrandr --output "$PRIMARY_DISPLAY" --brightness .1' \
'xrandr --output "$PRIMARY_DISPLAY" --brightness 1' \
--timer 600 \
'xrandr --output "$PRIMARY_DISPLAY" --brightness 1; systemctl suspend' \
''