|
@@ -0,0 +1,53 @@
|
|
1
|
+#!/bin/bash
|
|
2
|
+
|
|
3
|
+. <(ffoom init)
|
|
4
|
+ffoo import core
|
|
5
|
+ffoo import ini
|
|
6
|
+
|
|
7
|
+FFOO_INI_PATH="__FFOO_INI_PATH__"
|
|
8
|
+
|
|
9
|
+usage() {
|
|
10
|
+ usage_is "[-l|--lines] [-d|--delim] [-e|--read-eeini]"
|
|
11
|
+}
|
|
12
|
+
|
|
13
|
+numbered=false
|
|
14
|
+lines=10
|
|
15
|
+maybe_cut=cat
|
|
16
|
+maybe_read_eeini=cat
|
|
17
|
+
|
|
18
|
+while true; do case $1 in
|
|
19
|
+ -l|--lines) lines=$2; shift 2 ;;
|
|
20
|
+ -d|--delim) delim=$2; shift 2 ;;
|
|
21
|
+ -e|--read-eeini) read_eeini=$2; delim='='; shift 2 ;;
|
|
22
|
+ "") break ;;
|
|
23
|
+ *) usage
|
|
24
|
+esac done
|
|
25
|
+
|
|
26
|
+test -n "$delim" && maybe_cut=do_cut
|
|
27
|
+test -n "$read_eeini" && maybe_read_eeini=do_read_eeini
|
|
28
|
+
|
|
29
|
+host=$(hostname -s)
|
|
30
|
+nb="$(iniread -p style.color.nbg)"
|
|
31
|
+nf="$(iniread -p style.color.nfg)"
|
|
32
|
+sb="$(iniread -p style.color.sng)"
|
|
33
|
+sf="$(iniread -p style.color.sfg)"
|
|
34
|
+fn="$(iniread -p style.font)"
|
|
35
|
+fn=${fn:--*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*}
|
|
36
|
+arg_nb="${nb:+-nb $nb}"
|
|
37
|
+arg_nf="${nf:+-nf $nf}"
|
|
38
|
+arg_sb="${sb:+-sb $sb}"
|
|
39
|
+arg_sf="${sf:+-sf $sf}"
|
|
40
|
+arg_fn="${fn:+-fn $fn}"
|
|
41
|
+style="$arg_nb $arg_nf $arg_sb $arg_sf $arg_fn"
|
|
42
|
+
|
|
43
|
+do_cut() {
|
|
44
|
+ cut -d$delim -f2-
|
|
45
|
+}
|
|
46
|
+
|
|
47
|
+do_read_eeini() {
|
|
48
|
+ iniread $read_eeini
|
|
49
|
+}
|
|
50
|
+
|
|
51
|
+$maybe_read_eeini \
|
|
52
|
+ | dmenu -l $lines $style \
|
|
53
|
+ | $maybe_cut
|