Browse Source

Use inigrep directly inside saturnin

... turns out it's faster (surprise! ;))
Alois Mahdal 9 years ago
parent
commit
09a0a735c9

+ 1
- 1
src/bin/saturnin.skel View File

53
 }
53
 }
54
 
54
 
55
 run_hook() {
55
 run_hook() {
56
-    saturnin conf -j -p hook.$SATURNIN_SUBCOMMAND.$1 \
56
+    inigrep -j -p hook.$SATURNIN_SUBCOMMAND.$1 \
57
       | debug_pipe hook_$1 \
57
       | debug_pipe hook_$1 \
58
       | bash
58
       | bash
59
 }
59
 }

+ 2
- 1
src/ffoo/saturnin_zleep.sh View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
+ffoo import config
3
 ffoo import pretty
4
 ffoo import pretty
4
 ffoo import sync
5
 ffoo import sync
5
 
6
 
18
 
19
 
19
 __zleep_try_umount_all() {
20
 __zleep_try_umount_all() {
20
     local mp
21
     local mp
21
-    for mp in $(saturnin conf -p iam.mounting.point);
22
+    for mp in $(inigrep -p iam.mounting.point);
22
     do
23
     do
23
         __zleep_try_umount $mp || return 1
24
         __zleep_try_umount $mp || return 1
24
     done
25
     done

+ 7
- 5
src/libexec/saturnin-dmenu View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
 . $(ffoom path)
3
 . $(ffoom path)
4
+
5
+ffoo import config
4
 ffoo import pretty
6
 ffoo import pretty
5
 
7
 
6
 usage() {
8
 usage() {
21
     *)              break             ;;
23
     *)              break             ;;
22
 esac done
24
 esac done
23
 
25
 
24
-nb="$(saturnin conf -p style.color.nbg)"
25
-nf="$(saturnin conf -p style.color.nfg)"
26
-sb="$(saturnin conf -p style.color.sbg)"
27
-sf="$(saturnin conf -p style.color.sfg)"
28
-fn="$(saturnin conf -p style.font)"
26
+nb="$(inigrep -p style.color.nbg)"
27
+nf="$(inigrep -p style.color.nfg)"
28
+sb="$(inigrep -p style.color.sbg)"
29
+sf="$(inigrep -p style.color.sfg)"
30
+fn="$(inigrep -p style.font)"
29
 fn=${fn:--*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*}
31
 fn=${fn:--*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*}
30
 
32
 
31
 debug -v nb nf sb sf fn lines maybe_split delim
33
 debug -v nb nf sb sf fn lines maybe_split delim

+ 6
- 5
src/libexec/saturnin-iam View File

2
 
2
 
3
 . $(ffoom path)
3
 . $(ffoom path)
4
 
4
 
5
+ffoo import config
5
 ffoo import pretty
6
 ffoo import pretty
6
 ffoo import sync
7
 ffoo import sync
7
 
8
 
41
     #
42
     #
42
     # what is my physical location?
43
     # what is my physical location?
43
     #
44
     #
44
-    if=$(saturnin conf -p iam.using.if)
45
+    if=$(inigrep -p iam.using.if)
45
     gwmac=$(arp | grep "^gateway\\>.*\\<$if\$" | tr ' ' '\n' | grep :)
46
     gwmac=$(arp | grep "^gateway\\>.*\\<$if\$" | tr ' ' '\n' | grep :)
46
-    saturnin conf -p iam.seeing.gw.$gwmac || echo OUT
47
+    inigrep -p iam.seeing.gw.$gwmac || echo OUT
47
 }
48
 }
48
 
49
 
49
 set_status() {
50
 set_status() {
51
     # set public status $1 by command in conf file
52
     # set public status $1 by command in conf file
52
     #
53
     #
53
     local what=$1
54
     local what=$1
54
-    saturnin conf -p iam.saying.like.this.$what | bash
55
+    inigrep -p iam.saying.like.this.$what | bash
55
 }
56
 }
56
 
57
 
57
 
58
 
63
     local name=$1
64
     local name=$1
64
     local cmd=$2
65
     local cmd=$2
65
     local arg=$3
66
     local arg=$3
66
-    saturnin conf -p iam.hooking.$name.$cmd \
67
+    inigrep -p iam.hooking.$name.$cmd \
67
       | SATURNIN_IAM_CMD=$cmd \
68
       | SATURNIN_IAM_CMD=$cmd \
68
         SATURNIN_IAM_ARG=$arg \
69
         SATURNIN_IAM_ARG=$arg \
69
         bash
70
         bash
129
     #
130
     #
130
     # i.e. hibernated
131
     # i.e. hibernated
131
     #
132
     #
132
-    saturnin conf -p iam.undocking.like | bash -
133
+    inigrep -p iam.undocking.like | bash -
133
 }
134
 }
134
 
135
 
135
 i_am_zleeping() {
136
 i_am_zleeping() {

+ 3
- 2
src/libexec/saturnin-kb View File

2
 
2
 
3
 . $(ffoom path)
3
 . $(ffoom path)
4
 
4
 
5
+ffoo import config
5
 ffoo import pretty
6
 ffoo import pretty
6
 
7
 
7
 
8
 
17
     # change layout to the next one in row
18
     # change layout to the next one in row
18
     #
19
     #
19
     local cur="$current_layout"
20
     local cur="$current_layout"
20
-    local all="$(saturnin conf -p kb.layout)"
21
+    local all="$(inigrep -p kb.layout)"
21
     local def="$default_layout"
22
     local def="$default_layout"
22
     local nxt=$(
23
     local nxt=$(
23
         echo -e "$all\n$all" \
24
         echo -e "$all\n$all" \
30
     echo "$nxt"
31
     echo "$nxt"
31
 }
32
 }
32
 
33
 
33
-default_layout="$(saturnin conf -1 -p kb.layout)"
34
+default_layout="$(inigrep -1 -p kb.layout)"
34
 current_layout="$(setxkbmap -v | grep '^symbols: ' | cut -d+ -f2)"
35
 current_layout="$(setxkbmap -v | grep '^symbols: ' | cut -d+ -f2)"
35
 
36
 
36
 layout=""
37
 layout=""

+ 2
- 1
src/libexec/saturnin-ln View File

2
 
2
 
3
 . $(ffoom path)
3
 . $(ffoom path)
4
 
4
 
5
+ffoo import config
5
 ffoo import pretty
6
 ffoo import pretty
6
 
7
 
7
 DEFAULT_TARGET=$HOME
8
 DEFAULT_TARGET=$HOME
26
 }
27
 }
27
 
28
 
28
 load() {
29
 load() {
29
-    saturnin conf -p ln.dir.$1 | expand_tilde
30
+    inigrep -p ln.dir.$1 | expand_tilde
30
 }
31
 }
31
 
32
 
32
 while true; do case $1 in
33
 while true; do case $1 in