From: Siraaj Khandkar Date: Sat, 18 Aug 2018 14:21:18 +0000 (-0400) Subject: Fix missing default value when mute field is unknown X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=2dbee5ea684e158e3a6e8ce375111e32ae7e9fdb;p=khatus.git Fix missing default value when mute field is unknown --- diff --git a/bin/khatus_bar b/bin/khatus_bar index 2a517a1..bf151b8 100755 --- a/bin/khatus_bar +++ b/bin/khatus_bar @@ -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) }