#!/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