summaryrefslogtreecommitdiff
path: root/dmenu/dmenu_run
diff options
context:
space:
mode:
Diffstat (limited to 'dmenu/dmenu_run')
-rwxr-xr-xdmenu/dmenu_run15
1 files changed, 13 insertions, 2 deletions
diff --git a/dmenu/dmenu_run b/dmenu/dmenu_run
index 71a15d7..a9e23b6 100755
--- a/dmenu/dmenu_run
+++ b/dmenu/dmenu_run
@@ -1,3 +1,14 @@
#!/bin/sh
-LANG="en_US.UTF-8"
-dmenu_path | dmenu "$@" | ${SHELL:-"/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