1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #!/bin/bash
-
- . <(ffoom init)
- ffoo import core
- ffoo import ini
-
- FFOO_INI_PATH="__FFOO_INI_PATH__"
-
- usage() {
- usage_is "[-l|--lines] [-d|--delim] [-e|--read-eeini]"
- }
-
- numbered=false
- lines=10
- maybe_cut=cat
- maybe_read_eeini=cat
-
- while true; do case $1 in
- -l|--lines) lines=$2; shift 2 ;;
- -d|--delim) delim=$2; shift 2 ;;
- -e|--read-eeini) read_eeini=$2; delim='='; shift 2 ;;
- "") break ;;
- *) usage
- esac done
-
- test -n "$delim" && maybe_cut=do_cut
- test -n "$read_eeini" && maybe_read_eeini=do_read_eeini
-
- host=$(hostname -s)
- nb="$(iniread -p style.color.nbg)"
- nf="$(iniread -p style.color.nfg)"
- sb="$(iniread -p style.color.sng)"
- sf="$(iniread -p style.color.sfg)"
- fn="$(iniread -p style.font)"
- fn=${fn:--*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*}
- arg_nb="${nb:+-nb $nb}"
- arg_nf="${nf:+-nf $nf}"
- arg_sb="${sb:+-sb $sb}"
- arg_sf="${sf:+-sf $sf}"
- arg_fn="${fn:+-fn $fn}"
- style="$arg_nb $arg_nf $arg_sb $arg_sf $arg_fn"
-
- do_cut() {
- cut -d$delim -f2-
- }
-
- do_read_eeini() {
- iniread $read_eeini
- }
-
- $maybe_read_eeini \
- | dmenu -l $lines $style \
- | $maybe_cut
|