123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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] [-s|--split CHAR]"
  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. -s|--split) delim=$2; shift 2 ;;
  15. "") break ;;
  16. *) usage
  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.sng)"
  23. sf="$(iniread -p style.color.sfg)"
  24. fn="$(iniread -p style.font)"
  25. fn=${fn:--*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*}
  26. arg_nb="${nb:+-nb $nb}"
  27. arg_nf="${nf:+-nf $nf}"
  28. arg_sb="${sb:+-sb $sb}"
  29. arg_sf="${sf:+-sf $sf}"
  30. arg_fn="${fn:+-fn $fn}"
  31. style="$arg_nb $arg_nf $arg_sb $arg_sf $arg_fn"
  32. do_split() {
  33. cut -d$delim -f2-
  34. }
  35. dmenu -l $lines $style \
  36. | $maybe_split