X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=src%2Fawk%2Fexe%2Fbar.awk;h=bd37305c57ad6de37d7c6f1b30eab929c3b44cf8;hb=0c4f892ec9d0cd7dc87c83c01b52259d0aed1ae3;hp=43126ffd2b1906e7da215bd58b8630c220d00f7b;hpb=1cdd2ba229f2086b9270617872de9c312adc1d11;p=khatus.git diff --git a/src/awk/exe/bar.awk b/src/awk/exe/bar.awk index 43126ff..bd37305 100644 --- a/src/awk/exe/bar.awk +++ b/src/awk/exe/bar.awk @@ -10,15 +10,18 @@ # ----------------------------------------------------------------------------- # Input # ----------------------------------------------------------------------------- -$3 == "data" { - delete msg - msg_in_parse(msg, $0) +{ + delete msg + msg_parse(msg, $0) +} + +msg["type"] == "data" { cache_update(msg["node"], msg["module"], msg["key"], msg["val"]) } -$1 == Node && \ -$2 == "khatus_sensor_datetime" && \ -$3 == "data" { +msg["node"] == Node && \ +msg["module"] == "khatus_sensor_datetime" && \ +msg["type"] == "data" { # Code for bar_make_status is expected to be passed as an # additional source file, using -f flag. msg_out_status_bar(bar_make_status()) @@ -191,17 +194,17 @@ function bar_make_status_backlight_percent( src) { # Volume # ----------------------------------------------------------------------------- -function bar_make_status_volume_pulseaudio_sink(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) +function bar_make_status_volume_alsa_device(device, mu, vl, vr, show) { + cache_get(mu, "khatus_sensor_volume", "mute" Kfs device, 5) + cache_get(vl, "khatus_sensor_volume", "vol_left" Kfs device, 5) + cache_get(vr, "khatus_sensor_volume", "vol_right" Kfs device, 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"]} else { msg_out_log_error(\ - "bar_make_status_volume_pulseaudio_sink: " sink ". ", \ + "bar_make_status_volume_alsa_device: " device ". ", \ "Unexpected value for 'mute' field: " mu["value"] \ ) }