aboutsummaryrefslogtreecommitdiff
path: root/dwm/Repositories/dmenu/dmenu_path
diff options
context:
space:
mode:
authorbard <[email protected]>2024-04-15 06:24:14 -0400
committerbard <[email protected]>2024-04-15 06:24:14 -0400
commit168120d4068eff9816c11f0503738c12861821ae (patch)
tree635e839eeca920432fcaa8417b282e074e84a4c2 /dwm/Repositories/dmenu/dmenu_path
initial commit
Diffstat (limited to 'dwm/Repositories/dmenu/dmenu_path')
-rwxr-xr-xdwm/Repositories/dmenu/dmenu_path13
1 files changed, 13 insertions, 0 deletions
diff --git a/dwm/Repositories/dmenu/dmenu_path b/dwm/Repositories/dmenu/dmenu_path
new file mode 100755
index 0000000..3a7cda7
--- /dev/null
+++ b/dwm/Repositories/dmenu/dmenu_path
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
+cache="$cachedir/dmenu_run"
+
+[ ! -e "$cachedir" ] && mkdir -p "$cachedir"
+
+IFS=:
+if stest -dqr -n "$cache" $PATH; then
+ stest -flx $PATH | sort -u | tee "$cache"
+else
+ cat "$cache"
+fi