summaryrefslogtreecommitdiff
path: root/dmenu/dmenu_run
blob: a9e23b60ea28881686ae7fbcd95f7ce92358eb84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

# dmenu_run improved
# command ending with '!', is started in the terminal.

test -s "$HOME"/.dmenurc && . "$HOME"/.dmenurc

cmd="$(dmenu_path | dmenu -H "${XDG_CACHE_HOME:-$HOME/.cache/}/dmenu_run.hist" "$@")"

case $cmd in
'') ;;
*\;) exec "${TERMINAL:-st}" -e ${cmd%?} & ;;
*) exec ${cmd} & ;;
esac