dmenu_path 380 B

123456789101112131415161718
  1. #!/usr/bin/env bash
  2. config_file="$HOME/.config/dmenu/aliases"
  3. [ -e "$config_file" ] && source "$config_file"
  4. cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
  5. cache="$cachedir/dmenu_run"
  6. [ ! -e "$cachedir" ] && mkdir -p "$cachedir"
  7. IFS=:
  8. if stest -dqr -n "$cache" $PATH; then
  9. # stest -flx $PATH | sort -u | tee "$cache"
  10. compgen -ac | sort -u | tee "$cache"
  11. else
  12. cat "$cache"
  13. fi