OSDN Git Service

add suspend option
authorpaperbenni <paperbenni@gmail.com>
Tue, 28 Jul 2020 12:35:00 +0000 (14:35 +0200)
committerpaperbenni <paperbenni@gmail.com>
Tue, 28 Jul 2020 12:35:00 +0000 (14:35 +0200)
programs/instantshutdown

index c5847cd..63a6542 100755 (executable)
@@ -11,12 +11,13 @@ if [ "$(pgrep instantshutdown | wc -l)" -gt 2 ]; then
     exit
 fi
 
-answer=$(echo "cancel
+answer="$(echo 'cancel
 shutdown
 logout
 reboot
 lock screen
-kill wm" | instantmenu -l 10 -w -1 -c -n -F -p "do you want to shut down?")
+suspend
+restart wm' | instantmenu -l 10 -w -1 -c -n -F -p 'shutdown menu' -q 'select')"
 
 # if there are apps open, ask for confirmation
 zconfirm() {
@@ -35,13 +36,13 @@ zconfirm() {
 }
 
 case "$answer" in
-s*)
+shut*)
     zconfirm "shutdown"
     rm ~/.instantosrunning
     sleep 0.4
     shutdown now
     ;;
-r*)
+reb*)
     zconfirm "reboot"
     rm ~/.instantosrunning
     sleep 0.4
@@ -56,7 +57,11 @@ log*)
 loc*)
     ilock
     ;;
-k*)
+sus*)
+    systemctl suspend
+    ilock
+    ;;
+res*)
     pkill instantwm
     ;;
 *)