dmenu_most_used 802 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #! /bin/mksh
  2. . $(realpath "$0" | xargs dirname)/dmenuconf
  3. shellex()
  4. {
  5. SCRIPTSH=$(grep -m 1 "#!" "$1" | sed 's/#!//')
  6. exec $SCRIPTSH "$1" &
  7. return 0
  8. }
  9. AAA="$(exec dmenu -f -i -b -p EXEC -nb "$DMENUBG" -nf "$DMENUFG" -sb "$DMENUFG" -sf "$DMENUBG" -fn "$DMENUFONT" <<< "$APPLIST")"
  10. for cmdname in $LINKLIST ; do
  11. if [ "$cmdname" == "$AAA" ] ; then
  12. exec "$LINKPATH/$cmdname" &
  13. exit 0
  14. fi
  15. done
  16. for cmdname in $SHELLDIRLIST ; do
  17. if [ "$cmdname" == "$AAA" ] ; then
  18. shellex "$SHELLDIRPATH/$cmdname"
  19. exit 0
  20. fi
  21. done
  22. for cmdname in $APPIMAGELIST ; do
  23. if [ "$cmdname" == "$AAA" ] ; then
  24. exec "$APPIMAGEPATH/$cmdname" &
  25. exit 0
  26. fi
  27. done
  28. case "$AAA" in
  29. "scrot selection") scrot -s & ;;
  30. "maim selection") maim -s ~/"$(date +%Y-%m-%d-%k%M%S_maim.png)" & ;;
  31. *) exec "$AAA" & ;;
  32. esac
  33. exit 0