eedmenu.in 999B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. 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 -i -l $lines $(style) "$@" | $maybe_split