dotfiles/bin/idle
Morgan McMillian 15cc287024 adjust timeouts
2021-04-16 06:40:58 -07:00

19 lines
458 B
Bash
Executable file

#!/bin/bash
BACKGROUND=~/.background_lock
LOCK_TMOUT=1800 # was 900
SLEEP_TMOUT=7200 # was 3600
swayidle -w \
timeout ${LOCK_TMOUT} "swaylock -f -i ${BACKGROUND}" \
timeout ${SLEEP_TMOUT} 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
before-sleep "swaylock -f -i ${BACKGROUND}" &
pgrep swayidle
RT=$?
if [ $RT -eq 0 ]
then
notify-send -t 1000 idle "Screensaver enabled"
else
notify-send idle "Unable to enable screensaver"
fi