diff options
Diffstat (limited to 'dmenu/dmenu_run')
| -rwxr-xr-x | dmenu/dmenu_run | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/dmenu/dmenu_run b/dmenu/dmenu_run index c22468b..834ede5 100755 --- a/dmenu/dmenu_run +++ b/dmenu/dmenu_run @@ -1,32 +1,2 @@ #!/bin/sh -# end a command with ; to run in a terminal - -term="${TERMINAL:-st} -e" -cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"} -cache="$cachedir/dmenu_recent" - -touch "$cache" - -# cleaning -sort -u "$cache" | while read cmd; do - command -v "${cmd%;}" >/dev/null 2>&1 || sed -i "/$cmd/d" "$cache" -done - -most_used=$(sort "$cache" | uniq -c | sort -rh | sed 's/\s*//' | cut -d' ' -f2-) -run=$( ( - echo "$most_used" - dmenu_path | grep -vxF "$most_used" -) | dmenu -i "$@") - -[ -z "$run" ] && exit 1 - -( - echo "$run" - head -n 99 "$cache" -) >"$cache.$$" -mv "$cache.$$" "$cache" - -case "$run" in -*\;) exec $(echo $term ${run%;}) ;; -*) exec "$run" ;; -esac +dmenu_path | dmenu "$@" | ${SHELL:-"/bin/sh"} & |
