Browse Source

New eeiam command: bbl to switch kb layout

bbl is for Babylon
Alois Mahdal 10 years ago
parent
commit
e1bcc880be
1 changed files with 19 additions and 0 deletions
  1. 19
    0
      bin/eeiam.in

+ 19
- 0
bin/eeiam.in View File

16
     echo afk
16
     echo afk
17
     echo at
17
     echo at
18
     echo back
18
     echo back
19
+    echo bbl
19
     echo gone
20
     echo gone
20
     echo moving
21
     echo moving
21
     echo ooo
22
     echo ooo
113
     klist || urxvt -e kinit
114
     klist || urxvt -e kinit
114
 }
115
 }
115
 
116
 
117
+i_am_bbl() {
118
+    #
119
+    # changing language
120
+    #
121
+    local cur=$(setxkbmap -v | grep '^symbols: ' | cut -d+ -f2)
122
+    local all="$(iniread    -p iam.typing.lang)"
123
+    local def="$(iniread -1 -p iam.typing.lang)"
124
+    local nxt=$(
125
+        echo -e "$all\n$all" \
126
+          | grep -m 1 -A 1 $cur \
127
+          | tail -1
128
+    )
129
+    test -z "$nxt" && nxt=$def
130
+    test -z "$nxt" && nxt=us
131
+    debug -v all def cur nxt
132
+    setxkbmap "$nxt"
133
+}
134
+
116
 i_am_gone() {
135
 i_am_gone() {
117
     #
136
     #
118
     # gone fishin'
137
     # gone fishin'