khatus_sensor_memory \
khatus_sensor_mpd \
khatus_sensor_net_addr_io \
+ khatus_sensor_net_carrier \
khatus_sensor_net_wifi_status \
khatus_sensor_procs \
khatus_sensor_screen_brightness \
# Network
# -----------------------------------------------------------------------------
-function bar_make_status_net_iface_status(interface, addr) {
- cache_get(addr, "khatus_sensor_net_addr_io", "addr" Kfs interface, 5)
- if (!addr["is_expired"] && addr["value"])
- return "up"
+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"])
+ return "<>"
else
return "--"
}
["--interval_bluetooth"]=1
["--interval_net_wifi"]=1
["--interval_net_io"]=1
+ ["--interval_net_carrier"]=1
["--interval_disk_space"]=1
["--interval_disk_io"]=1
["--interval_loadavg"]=1
fork_poller "${opts['--interval_temp']}" "$perf" "$pipe" "$bin" "$cmd_sens_temperature"
fork_poller "${opts['--interval_fan']}" "$perf" "$pipe" "$bin" "$cmd_sens_fan"
fork_poller "${opts['--interval_mem']}" "$perf" "$pipe" "$bin" "$cmd_sens_memory"
+ fork_poller "${opts['--interval_net_carrier']}" "$perf" "$pipe" "$bin" khatus_sensor_net_carrier
stdbuf -o L tail -f "$pipe"
}
--- /dev/null
+#! /bin/sh
+
+for interface in $(ls /sys/class/net)
+do
+ printf "%s %d\n" $interface $(cat /sys/class/net/$interface/carrier)
+done