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