summaryrefslogtreecommitdiff
path: root/sd/dmenu-5.0/dmenu_path
diff options
context:
space:
mode:
authorstkhan <personal@slickd.xyz>2021-06-19 10:42:34 -0500
committerstkhan <personal@slickd.xyz>2021-06-19 10:42:34 -0500
commite2dbb81b9144fd8be2eb89617db38fd361079fed (patch)
tree77cdbe3673b967c594327c878379aaae9c56daaf /sd/dmenu-5.0/dmenu_path
parente8df46e3babbb943a729935786a0d55dbe0e2028 (diff)
1.0.0b2
Former-commit-id: 7e8e8ad1998285a5b38c4bedd38acd0bbe37de4d
Diffstat (limited to 'sd/dmenu-5.0/dmenu_path')
-rwxr-xr-xsd/dmenu-5.0/dmenu_path13
1 files changed, 13 insertions, 0 deletions
diff --git a/sd/dmenu-5.0/dmenu_path b/sd/dmenu-5.0/dmenu_path
new file mode 100755
index 0000000..3a7cda7
--- /dev/null
+++ b/sd/dmenu-5.0/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