sysact (625B) - raw


      1 #!/bin/sh
      2 
      3 # A dmenu wrapper script for system functions.
      4 
      5 # For non-systemd init systems.
      6 case "$(readlink -f /sbin/init)" in
      7 	*runit*) hib="sudo -A zzz" ;;
      8 	*openrc*) reb="sudo -A openrc-shutdown -r"; shut="sudo -A openrc-shutdown -p 0" ;;
      9 esac
     10 
     11 cmds="\
     12   lock	sudo loginctl lock-sessions
     13   leave dwm	killall xinit
     14   renew dwm	killall dwm
     15   hibernate	sudo loginctl hibernate
     16   reboot	${reb:-sudo -A reboot}
     17   shutdown	${shut:-sudo -A shutdown -h now}
     18   display off 	 xset dpms force off"
     19 
     20 choice="$(echo "$cmds" | cut -d'	' -f 1 | dmenu)" || exit 1
     21 
     22 `echo "$cmds" | grep "^$choice	" | cut -d '	' -f2-`