Fix missing default value when mute field is unknown
authorSiraaj Khandkar <siraaj@khandkar.net>
Sat, 18 Aug 2018 14:21:18 +0000 (10:21 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Sat, 18 Aug 2018 14:21:18 +0000 (10:21 -0400)
bin/khatus_bar

index 2a517a1..bf151b8 100755 (executable)
@@ -261,7 +261,6 @@ function make_status_volume(    sink, mu, vl, vr, show) {
     cache_get(mu, "khatus_sensor_volume", "mute"      Kfs sink, 5)
     cache_get(vl, "khatus_sensor_volume", "vol_left"  Kfs sink, 5)
     cache_get(vr, "khatus_sensor_volume", "vol_right" Kfs sink, 5)
-
     if (!mu["is_expired"] && !vl["is_expired"] && !vr["is_expired"]) {
              if (mu["value"] == "yes") {show = "X"}
         else if (mu["value"] == "no")  {show = vl["value"] " " vr["value"]}
@@ -270,11 +269,11 @@ function make_status_volume(    sink, mu, vl, vr, show) {
                 "make_status_volume", \
                 "Unexpected value for 'mute' field: " mu["value"] \
             )
+            show = "--"
         }
     } else {
         show = "--"
     }
-
     return sprintf("(%s)", show)
 }
 
This page took 0.027694 seconds and 4 git commands to generate.