function bar_make_status_net_iface_status(interface, is_plugged_in) {
# TODO: Integrate connection/address status into the symbol somehow.
cache_get(is_plugged_in, "khatus_sensor_net_carrier", interface, 5)
- if (!is_plugged_in["is_expired"] && is_plugged_in["value"])
+ if (!is_plugged_in["is_expired"] && is_plugged_in["value"] == 1)
return "<>"
else
return "--"
return cache_get_fmt_def(src, "status" Kfs interface, 10, "%s")
}
+function bar_make_status_net_wifi_link(interface, link) {
+ 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
+ return "--"
+}
+
# -----------------------------------------------------------------------------
# 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")