sysact (396B)
1 #!/bin/sh 2 3 # use dmenu to select and perform a system action 4 5 SUCMD=doas 6 7 options="\ 8 lock 9 suspend 10 reboot 11 shutdown" 12 13 case ${1:-$(echo "$options" | dmenu -i -p "Action:")} in 14 lock) ibus engine xkb:us::eng ; slock ;; 15 suspend) $SUCMD /sbin/zzz ;; 16 reboot) $SUCMD /sbin/shutdown -r now ;; 17 shutdown) $SUCMD /sbin/shutdown -h now ;; 18 *) echo "usage: $0 [lock|suspend|reboot|shutdown]" 19 exit 1 ;; 20 esac