eedmenu.in 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/bash
  2. . <(ffoom init)
  3. ffoo import core
  4. ffoo import ini
  5. FFOO_INI_PATH="__FFOO_INI_PATH__"
  6. usage() {
  7. usage_is "[-l|--lines NUM] [--split CHAR] ARGS..."
  8. }
  9. numbered=false
  10. lines=10
  11. maybe_split=cat
  12. while true; do case $1 in
  13. -l|--lines) lines=$2; shift 2 ;;
  14. --split) delim=$2; shift 2 ;;
  15. --help|--usage) usage ;;
  16. *) break ;;
  17. esac done
  18. test -n "$delim" && maybe_split=do_split
  19. host=$(hostname -s)
  20. nb="$(iniread -p style.color.nbg)"
  21. nf="$(iniread -p style.color.nfg)"
  22. sb="$(iniread -p style.color.sbg)"
  23. sf="$(iniread -p style.color.sfg)"
  24. fn="$(iniread -p style.font)"
  25. fn=${fn:--*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*}
  26. debug -v nb nf sb sf fn
  27. style() {
  28. test -n "$nb" && echo -n "-nb $nb "
  29. test -n "$nf" && echo -n "-nf $nf "
  30. test -n "$sb" && echo -n "-sb $sb "
  31. test -n "$sf" && echo -n "-sf $sf "
  32. test -n "$fn" && echo -n "-fn $fn "
  33. }
  34. do_split() {
  35. cut -d$delim -f2-
  36. }
  37. dmenu -i -l $lines $(style) "$@" | $maybe_split