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.

26 lines
491 B

  1. #!/bin/sh -f
  2. CACHE=$HOME/.dmenu_cache
  3. IFS=:
  4. qfind() {
  5. find "$@" 2>/dev/null
  6. }
  7. uptodate() {
  8. test -f $CACHE &&
  9. test "$(echo "$PATH")" = "$(sed 1q "$CACHE")" &&
  10. ! qfind $PATH -maxdepth 0 -newer $CACHE >/dev/null
  11. }
  12. if ! uptodate
  13. then
  14. {
  15. echo "$PATH"
  16. qfind $PATH -type f -maxdepth 1 '(' -perm -u+x -o -perm -g+x -o -perm -o+x ')' |
  17. sed 's,.*/,,' | sort | uniq
  18. }
  19. mv $CACHE.$pid $CACHE
  20. fi
  21. tail -n +2 $CACHE