sway: add screensaver: lock and turn off display

This commit is contained in:
Konstantin Koslowski 2025-01-03 13:56:06 +01:00
parent 6c50990ed6
commit b6fcc08f61
3 changed files with 30 additions and 12 deletions

View file

@ -7,7 +7,8 @@ SCROT_APP_ARGS=" -t png -l 0"
SCROT_FILE_BASE=$HOME/.lockscreen
SCROT_FILE_EXT=png
LOCK_APP=swaylock
LOCK_ARGS=" -f -F -e -s fill -c 000000 --indicator-radius 100 --indicator-thickness 20"
# LOCK_ARGS=" -f -F -e -s fill -c 000000 --indicator-radius 100 --indicator-thickness 20"
LOCK_ARGS=" -F -e -s fill -c 000000 --indicator-radius 100 --indicator-thickness 20"
INHIBIT_FILE=$HOME/.inhibit_lock
CONVERT=convert
@ -70,6 +71,9 @@ case "$1" in
i*)
_set_inhibit $INHIBIT_FILE $2
;;
clean)
_clean
;;
lock)
_on
_screenshot
@ -88,13 +92,23 @@ case "$1" in
_on
_clean
;;
screensaver)
_screenshot
swayidle -w \
timeout 5 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' &
PID=$!
_lock
_clean
kill $PID
;;
screenshot)
_on
_screenshot
;;
*)
echo "invalid argument \"$1\""
echo "arguments: [inhibit [on|off]|lock|lockonly|off|on|screenshot]"
echo "arguments: [inhibit [on|off]|lock|lockonly|off|on|screensaver|screenshot]"
esac