Update screen locking

This commit is contained in:
Ryan 2023-12-03 14:28:53 +08:00
parent e08fe061df
commit 2e9e35e806
1 changed files with 7 additions and 5 deletions

View File

@ -3,9 +3,9 @@
# Modified from sway's locking script
if [[ ! -e /bin/swayidle ]]; then
notify-send "ERROR" "Swayidle not found"
exit 1
if [[ ! $(which swayidle 2> /dev/null) ]]; then
notify-send "ERROR" "Swayidle not found"
exit 1
fi
choice=`echo -e "suspend\nshutdown\npoweroff\nreboot\nlock" | wofi -d --prompt "󰚥 Choose power option" -Oalphabetical`
@ -16,10 +16,12 @@ if test "$choice" = lock ; then
timeout 10 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' \
&
idlepid=$!
swaylock -e -c 282828 --inside-color 00000003
# swaylock -e -c 282828 --inside-color 00000003
swaylock -S --effect-blur "5x5" --effect-vignette 0.5:0.5 --inside-color 00000003 \
-e --ring-color 00000005 --line-color 00000035
kill $idlepid
hyprctl dispatch dpms on
light -S $bright
else
elif test -n "$choice"; then
loginctl $choice
fi