eedmenu.in 1007B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. nb="$(iniread -p style.color.nbg)"
  20. nf="$(iniread -p style.color.nfg)"
  21. sb="$(iniread -p style.color.sbg)"
  22. sf="$(iniread -p style.color.sfg)"
  23. fn="$(iniread -p style.font)"
  24. fn=${fn:--*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*}
  25. debug -v nb nf sb sf fn
  26. style() {
  27. test -n "$nb" && echo -n "-nb $nb "
  28. test -n "$nf" && echo -n "-nf $nf "
  29. test -n "$sb" && echo -n "-sb $sb "
  30. test -n "$sf" && echo -n "-sf $sf "
  31. test -n "$fn" && echo -n "-fn $fn "
  32. }
  33. do_split() {
  34. cut -d$delim -f2-
  35. }
  36. dmenu -b -i -l $lines $(style) "$@" | $maybe_split