Browse Source

Add bmo-be state overwiew file to the i3status bar

Alois Mahdal 5 years ago
parent
commit
b0ae9b1be3
1 changed files with 16 additions and 2 deletions
  1. 16
    2
      dotfiles/i3/bin/i3staplus

+ 16
- 2
dotfiles/i3/bin/i3staplus View File

@@ -17,13 +17,27 @@ kb_layout() {
17 17
         "$layout" "$color"
18 18
 }
19 19
 
20
+bmo_be_ovw() {
21
+    local ovw_path=.local/share/bmo/be/important.state
22
+    local ovw
23
+    local color
24
+    test -s "$ovw_path" || return 0
25
+    ovw=$(cat "$ovw_path")
26
+    case $ovw in
27
+        "")     color='' ;;
28
+        *)      color=',"color": "#ff0000"' ;;
29
+    esac
30
+    printf '{"full_text": " %s"%s},' \
31
+        "$ovw" "$color"
32
+}
33
+
20 34
 i3status \
21 35
   | while true
22 36
     do
23 37
         read line
24 38
         case $line in
25
-            '[{'*)  line="[$(kb_layout){${line#\[\{}" ;;
26
-            ',[{'*) line=",[$(kb_layout){${line#,\[\{}" ;;
39
+            '[{'*)  line="[$(kb_layout)$(bmo_be_ovw){${line#\[\{}" ;;
40
+            ',[{'*) line=",[$(kb_layout)$(bmo_be_ovw){${line#,\[\{}" ;;
27 41
         esac
28 42
         echo "$line"
29 43
     done