2021-01-03 15:47:36 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
BACKGROUND=~/.background_lock
|
2021-04-16 13:40:58 +00:00
|
|
|
LOCK_TMOUT=1800 # was 900
|
|
|
|
SLEEP_TMOUT=7200 # was 3600
|
2021-01-03 15:47:36 +00:00
|
|
|
|
|
|
|
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}" &
|
2021-01-03 17:29:27 +00:00
|
|
|
pgrep swayidle
|
|
|
|
RT=$?
|
|
|
|
if [ $RT -eq 0 ]
|
|
|
|
then
|
|
|
|
notify-send -t 1000 idle "Screensaver enabled"
|
|
|
|
else
|
|
|
|
notify-send idle "Unable to enable screensaver"
|
|
|
|
fi
|