1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#!/usr/bin/env bash foo=$(printf "poweroff\nreboot\nquit\nreload" | rofi -dmenu -i -no-fixed-num-lines -no-custom -p "Action") if [[ -n $foo ]] then case "$foo" in poweroff) poweroff ;; reboot) /usr/bin/reboot ;; quit) herbstclient quit ;; reload) herbstclient reload ;; *) echo "Unknown command: $foo" ;; esac fi