Browse Source

Have module print comma as well

This makes it easier to join output from several modules and keep it
valid.  (Given modules *do* print the comma.)
Alois Mahdal 5 years ago
parent
commit
de98ccf2a8
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      dotfiles/i3/bin/i3staplus

+ 3
- 3
dotfiles/i3/bin/i3staplus View File

@@ -13,7 +13,7 @@ kb_layout() {
13 13
         us) color='' ;;
14 14
         *)  color=',"color": "red"' ;;
15 15
     esac
16
-    printf '{"full_text": " %s"%s}' \
16
+    printf '{"full_text": " %s"%s},' \
17 17
         "$layout" "$color"
18 18
 }
19 19
 
@@ -22,8 +22,8 @@ i3status \
22 22
     do
23 23
         read line
24 24
         case $line in
25
-            '[{'*)  line="[$(kb_layout),{${line#\[\{}" ;;
26
-            ',[{'*) line=",[$(kb_layout),{${line#,\[\{}" ;;
25
+            '[{'*)  line="[$(kb_layout){${line#\[\{}" ;;
26
+            ',[{'*) line=",[$(kb_layout){${line#,\[\{}" ;;
27 27
         esac
28 28
         echo "$line"
29 29
     done