Browse Source

Implement smarter way to start familiar

In ini file user can now specify how the familiar should be started,
i.e. that dropbox should be started by `dropbox start`, not `dropbox`
Alois Mahdal 10 years ago
parent
commit
74c8b3f201
1 changed files with 13 additions and 1 deletions
  1. 13
    1
      bin/eeiam.in

+ 13
- 1
bin/eeiam.in View File

55
     iniread -p iam.seeing.gw.$gwmac iam.ini || echo OUT
55
     iniread -p iam.seeing.gw.$gwmac iam.ini || echo OUT
56
 }
56
 }
57
 
57
 
58
+start_familiar() {
59
+    local f=$1
60
+    pids_matching $f && return 0
61
+    local like=$(iniread -p iam.starting.like.this.$f iam.ini)
62
+    debug -v f like
63
+    if test -n  "$like";
64
+        then
65
+            $like &
66
+        else $f &
67
+    fi
68
+}
69
+
58
 
70
 
59
 #
71
 #
60
 # subcommand handlers
72
 # subcommand handlers
79
     local f
91
     local f
80
     for f in $(familiars_at $(where_i_am));
92
     for f in $(familiars_at $(where_i_am));
81
     do
93
     do
82
-        pids_matching $f || $f &
94
+        start_familiar $f
83
     done
95
     done
84
     klist || urxvt -e kinit
96
     klist || urxvt -e kinit
85
 }
97
 }