mirror of
https://codeberg.org/frosty/dotfiles.git
synced 2024-09-19 03:37:10 -04:00
runsvdir: simplify xidlehook service
This commit is contained in:
parent
18598b5b7d
commit
0d9e9df555
|
@ -2,31 +2,11 @@
|
||||||
|
|
||||||
# shellcheck disable=SC2016
|
# 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 \
|
exec xidlehook \
|
||||||
--not-when-fullscreen \
|
--not-when-fullscreen \
|
||||||
--socket "$XIDLEHOOK_SOCK" \
|
--socket "$XIDLEHOOK_SOCK" \
|
||||||
--timer 600 \
|
--timer 600 \
|
||||||
'xrandr --output "$PRIMARY_DISPLAY" --brightness .1' \
|
'i3lock -i "$XDG_CACHE_HOME/lock.png"' \
|
||||||
'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 \
|
--timer 3600 \
|
||||||
'loginctl suspend' \
|
'loginctl suspend' \
|
||||||
|
|
Loading…
Reference in a new issue