#!/bin/sh execute_action() { case "$1" in quit) exec i3-msg exit ;; exec) shift eval exec "$@" ;; reload) exec i3-msg reload ;; restart) exec i3-msg restart ;; lock) exec lock ;; esac } cmd=$(cat << EOF | dmenu exec quit reload restart lock EOF ) execute_action $cmd