exit_check.sh (344B)
1 #!/bin/sh 2 3 # Use wofi to check if the user wants to exit sway. 4 5 # If wofi isn't installed, bail out immediately. 6 which wofi 7 if [ $? != 0 ]; then 8 swaymsg exit 9 fi 10 11 while [ "$choice" != "no" ] && [ "$choice" != "yes" ]; do 12 choice=$(echo -e 'no\nyes' | wofi --show dmenu -p "Really exit?") 13 done 14 if [ "$choice" = "yes" ]; then 15 swaymsg exit 16 fi