Simplify setting default volume symbol
authorSiraaj Khandkar <siraaj@khandkar.net>
Sat, 18 Aug 2018 14:29:13 +0000 (10:29 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Sat, 18 Aug 2018 14:29:13 +0000 (10:29 -0400)
bin/khatus_bar

index bf151b8..a3601f2 100755 (executable)
@@ -261,6 +261,7 @@ 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)
+    show = "--"
     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"]}
@@ -269,10 +270,7 @@ 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.031589 seconds and 4 git commands to generate.