*nohtml*

local/bin/system-menu

   1 #!/bin/bash
   2 
   3 system(){
   4     case $1 in
   5       reload) wall -r;;
   6      restart) ~/.xprofile;;
   7         lock) dm-tool lock;;
   8        sleep) systemctl suspend;;
   9         quit) killall $DESKTOP_SESSION Xorg;;
  10       reboot) reboot;;
  11     poweroff) poweroff;;
  12           '') grep -o '^\s\+\w\+)' $0 | tr -d ' )';;
  13     esac
  14 }
  15 
  16 s=$(system | while read i; do icon system-$i ${i^}; done |
  17 menu -i system -c 10 -l 2 | awk '{ print tolower($NF) }')
  18 
  19 [[ $s ]] && system $s