mirror of
https://codeberg.org/frosty/dotfiles.git
synced 2024-09-19 19:57:08 -04:00
34 lines
664 B
Plaintext
34 lines
664 B
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
# shellcheck disable=SC2016
|
||
|
|
||
|
while IFS= read -r line; do
|
||
|
case "$line" in
|
||
|
*primary*)
|
||
|
export PRIMARY_DISPLAY="${line%% *}"
|
||
|
break
|
||
|
;;
|
||
|
esac
|
||
|
done <<EOF
|
||
|
$(xrandr)
|
||
|
EOF
|
||
|
|
||
|
exec xidlehook \
|
||
|
--not-when-fullscreen \
|
||
|
--socket "$XIDLEHOOK_SOCK" \
|
||
|
--timer 600 \
|
||
|
'xrandr --output "$PRIMARY_DISPLAY" --brightness .1' \
|
||
|
'xrandr --output "$PRIMARY_DISPLAY" --brightness 1' \
|
||
|
--timer 10 \
|
||
|
'(
|
||
|
if [ -f "$XDG_CACHE_HOME/lock.png" ]; then
|
||
|
i3lock -i "$XDG_CACHE_HOME/lock.png"
|
||
|
else
|
||
|
i3lock
|
||
|
fi
|
||
|
); xrandr --output "$PRIMARY_DISPLAY" --brightness 1' \
|
||
|
'' \
|
||
|
--timer 3600 \
|
||
|
'loginctl suspend' \
|
||
|
''
|