3 ###################################################
4 ## shut down pc and break instantwm restart loop ##
5 ###################################################
7 # multiple instances would overlap
8 if [ "$(pgrep instantshutdown | wc -l)" -gt 2 ]; then
9 pgrep instantshutdown | wc -l
10 echo "instantshutdown already running"
17 answer="$(echo 'cancel
23 restart wm' | instantmenu -l 10 -w -1 -c -n -F -p 'shutdown menu' -q 'select')"
26 # if there are apps open, ask for confirmation
28 if wmctrl -l | grep -q '..'; then
29 echo "running applications found"
30 if imenu -c "there are apps running, sure you want to $1?"; then
38 echo "no running applications found"
43 # save current brightness
44 touch /tmp/shuttingdown
45 if CURBRIGHT="$(/usr/share/instantassist/utils/b.sh g)"; then
46 iconf savebright "$CURBRIGHT"
49 rm /tmp/instantosrunning
50 # these keep causing stop jobs
70 rm /tmp/instantosrunning