summaryrefslogtreecommitdiff
path: root/src/dmenu_path
diff options
context:
space:
mode:
authorSuleyman Farajli <suleyman@farajli.net>2024-08-05 21:57:44 +0400
committerSuleyman Farajli <suleyman@farajli.net>2024-08-05 21:57:44 +0400
commitd59f97cc66de35dd9c8616136548d93cc1dd7f05 (patch)
tree4abb1443121764e20bb7f2e465048961d382543a /src/dmenu_path
parentec65333610b477e49d66be4e8c21fcc1139c70d2 (diff)
directory layout changed and Makefile updated
Diffstat (limited to 'src/dmenu_path')
-rwxr-xr-xsrc/dmenu_path13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/dmenu_path b/src/dmenu_path
new file mode 100755
index 0000000..3a7cda7
--- /dev/null
+++ b/src/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