Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
pathcache="$cachedir/dmenu_run"
histcache="$cachedir/dmenu_history"
[ ! -e "$cachedir" ] && mkdir -p "$cachedir"
[ ! -e "$histcache" ] && touch "$histcache"
cmd="$( (tac "$histcache"; dmenu_path;) | dmenu "$@" )"