X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=x2%2Fsrc%2Fawk%2Fexe%2Fbar.awk;h=48e00f24216f960feadd0a6df018858a95352825;hb=900b9a6b1cf64ec6fc67bca260784ab93aec4fa1;hp=08750d4a2fa3f1940d8da5b7a111a4cd5567a80c;hpb=64771080860a88a15fd348815ad4135d8bec13cb;p=khatus.git diff --git a/x2/src/awk/exe/bar.awk b/x2/src/awk/exe/bar.awk index 08750d4..48e00f2 100644 --- a/x2/src/awk/exe/bar.awk +++ b/x2/src/awk/exe/bar.awk @@ -183,7 +183,7 @@ function bar_make_status_net_wifi(interface, src) { } function bar_make_status_net_wifi_link(interface, link) { - cache_get_fmt_def(link, "khatus_sensor_net_wifi_status", "link" Kfs interface, 10) + cache_get(link, "khatus_sensor_net_wifi_status", "link" Kfs interface, 10) if (!link["is_expired"] && link["value"] > 0) return sprintf("%d%%", link["value"]) else @@ -194,6 +194,14 @@ function bar_make_status_net_wifi_link(interface, link) { # Bluetooth # ----------------------------------------------------------------------------- +function bar_make_status_bluetooth( src, controllers, devices) { + src = "khatus_sensor_bluetooth" + controllers = cache_get_fmt_def(src, "count_powered_controllers", 10, "%d") + devices = cache_get_fmt_def(src, "count_connected_devices" , 10, "%d") + # Using %s format bellow because default value is a string + return sprintf("%s:%s", controllers, devices) +} + function bar_make_status_bluetooth_power( src) { src = "khatus_sensor_bluetooth_power" return cache_get_fmt_def(src, "power_status", 10, "%s") @@ -212,10 +220,10 @@ function bar_make_status_backlight_percent( src) { # Volume # ----------------------------------------------------------------------------- -function bar_make_status_volume_alsa_device(device, m, l, r, show) { - cache_get(m, "khatus_sensor_volume", "mute" Kfs device, 5) - cache_get(l, "khatus_sensor_volume", "vol_left" Kfs device, 5) - cache_get(r, "khatus_sensor_volume", "vol_right" Kfs device, 5) +function bar_make_status_volume( m, l, r, show) { + cache_get(m, "khatus_sensor_volume", "mute" , 5) + cache_get(l, "khatus_sensor_volume", "vol_left" , 5) + cache_get(r, "khatus_sensor_volume", "vol_right" , 5) show = "--" if (!m["is_expired"] && !l["is_expired"] && !r["is_expired"]) { if (m["value"] == "yes") @@ -224,7 +232,7 @@ function bar_make_status_volume_alsa_device(device, m, l, r, show) { show = l["value"] #" " r["value"] else msg_out_log_error(\ - "bar_make_status_volume_alsa_device: " device ". ", \ + "bar_make_status_volume", \ "Unexpected value for 'mute' field: " m["value"] \ ) } @@ -241,9 +249,9 @@ function bar_make_status_mpd( state, status) { if (state["value"] == "play") { status = bar_make_status_mpd_state_known("▶") } else if (state["value"] == "pause") { - status = bar_make_status_mpd_state_known("❚❚") + status = bar_make_status_mpd_state_known("⏸") } else if (state["value"] == "stop") { - status = bar_make_status_mpd_state_known("⬛") + status = bar_make_status_mpd_state_known("⏹") } else { msg_out_log_error(\ "bar_make_status_mpd", \