2021-08-16 22:21:31 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2021-11-03 21:05:39 +08:00
|
|
|
choice=`echo "suspend\nshutdown\npoweroff\nreboot\nlock" | wofi -d -Oalphabetical`
|
2021-08-16 22:21:31 +08:00
|
|
|
if test "$choice" = lock ; then
|
|
|
|
bright=`light`
|
|
|
|
swayidle -w \
|
|
|
|
timeout 5 "light -S 1" resume "light -S $bright" \
|
|
|
|
timeout 10 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
|
|
|
|
&
|
|
|
|
idlepid=$!
|
2022-04-02 11:18:07 +08:00
|
|
|
swaylock -e -c 2a2f33 --inside-color 00000003
|
2021-08-16 22:21:31 +08:00
|
|
|
kill $idlepid
|
|
|
|
swaymsg "output * dpms on"
|
|
|
|
light -S $bright
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
loginctl $choice
|