Bläddra i källkod

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 år sedan
förälder
incheckning
74c8b3f201
1 ändrade filer med 13 tillägg och 1 borttagningar
  1. 13
    1
      bin/eeiam.in

+ 13
- 1
bin/eeiam.in Visa fil

@@ -55,6 +55,18 @@ where_i_am() {
55 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 72
 # subcommand handlers
@@ -79,7 +91,7 @@ i_am_back() {
79 91
     local f
80 92
     for f in $(familiars_at $(where_i_am));
81 93
     do
82
-        pids_matching $f || $f &
94
+        start_familiar $f
83 95
     done
84 96
     klist || urxvt -e kinit
85 97
 }