2022-06-25 21:26:38 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-07-16 09:49:32 +08:00
|
|
|
choice=`echo -e "suspend\nshutdown\npoweroff\nreboot\nlock\nhibernate" | wofi -d -Oalphabetical`
|
2022-06-25 21:26:38 +08:00
|
|
|
if test "$choice" = lock ; then
|
|
|
|
bright=`light`
|
|
|
|
swayidle -w \
|
|
|
|
timeout 5 "light -S 1" resume "light -S $bright" \
|
2023-07-16 15:37:50 +08:00
|
|
|
timeout 10 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
|
2022-06-25 21:26:38 +08:00
|
|
|
&
|
|
|
|
idlepid=$!
|
2023-02-10 15:50:30 +08:00
|
|
|
swaylock -e -c 282828 --inside-color 00000003
|
2022-06-25 21:26:38 +08:00
|
|
|
kill $idlepid
|
2023-07-16 15:37:50 +08:00
|
|
|
swaymsg "output * power on"
|
2022-06-25 21:26:38 +08:00
|
|
|
light -S $bright
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
loginctl $choice
|