dmenu for lunch applications in dwm
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
391 B

  1. #!/bin/sh
  2. CACHE=$HOME/.dmenu_cache
  3. UPTODATE=1
  4. IFS=:
  5. uptodate() { [ $UPTODATE -eq 1 ]; }
  6. if test ! -f $CACHE
  7. then
  8. UPTODATE=0
  9. fi
  10. if uptodate
  11. then
  12. for dir in $PATH
  13. do
  14. test $dir -nt $CACHE && { UPTODATE=0; break; }
  15. done
  16. fi
  17. if ! uptodate
  18. then
  19. for dir in $PATH
  20. do
  21. for file in "$dir"/*
  22. do
  23. test -x "$file" && echo "${file##*/}"
  24. done
  25. done | sort | uniq > $CACHE
  26. fi
  27. cat $CACHE