- all = cache_get_fmt_def(src, "total_procs" , 15, "%d")
- r = cache_get_fmt_def(src, "total_per_state" Kfs "R", 15, "%d", "0")
- d = cache_get_fmt_def(src, "total_per_state" Kfs "D", 15, "%d", "0")
- t = cache_get_fmt_def(src, "total_per_state" Kfs "T", 15, "%d", "0")
- i = cache_get_fmt_def(src, "total_per_state" Kfs "I", 15, "%d", "0")
- z = cache_get_fmt_def(src, "total_per_state" Kfs "Z", 15, "%d", "0")
- return sprintf("P=[%s %sr %sd %st %si %sz]", all, r, d, t, i, z)
-}
-
-function bar_make_status_cpu( l, t, f) {
- l_src = "khatus_sensor_loadavg"
- t_src = "khatus_sensor_temperature"
- f_src = "khatus_sensor_fan"
- l = cache_get_fmt_def(l_src, "load_avg_1min", 5, "%4.2f")
- t = cache_get_fmt_def(t_src, "temp_c" , 5, "%d" )
- f = cache_get_fmt_def(f_src, "speed" , 5, "%4d" )
- return sprintf("C=[%s %s°C %srpm]", l, t, f)
-}
-
-function bar_make_status_disk( u, w, r, src_u, src_io) {
- src_u = "khatus_sensor_disk_space"
- src_io = "khatus_sensor_disk_io"
- u = cache_get_fmt_def(src_u , "disk_usage_percentage", 10, "%s")
- w = cache_get_fmt_def(src_io, "sectors_written" , 5, "%0.3f")
- r = cache_get_fmt_def(src_io, "sectors_read" , 5, "%0.3f")
- return sprintf("D=[%s%% %s▲ %s▼]", u, w, r)
-}
-
-function bar_make_status_net( \
- number_of_net_interfaces_to_show, \
- net_interfaces_to_show, \
- io, \
- wi, \
- i, \
- interface, \
- label, \
- wifi, \
- addr, \
- w, \
- r, \
- io_stat, \
- out, \
- sep \
-) {
- number_of_net_interfaces_to_show = \
- split(Opt_Net_Interfaces_To_Show, net_interfaces_to_show, ",")
- io = "khatus_sensor_net_addr_io"
- wi = "khatus_sensor_net_wifi_status"
- out = ""
- sep = ""
- for (i = number_of_net_interfaces_to_show; i > 0; i--) {
- interface = net_interfaces_to_show[i]
- label = substr(interface, 1, 1)
- if (interface ~ "^w") {
- wifi = cache_get_fmt_def(wi, "status" Kfs interface, 10, "%s")
- label = label ":" wifi
- }
- addr = cache_get_fmt_def(io, "addr" Kfs interface, 5, "%s", "")
- w = cache_get_fmt_def(io, "bytes_written" Kfs interface, 5, "%0.3f")
- r = cache_get_fmt_def(io, "bytes_read" Kfs interface, 5, "%0.3f")
- io_stat = addr ? sprintf("%s▲ %s▼", w, r) : "--"
- out = out sep label ":" io_stat
- sep = " "
- }
- return sprintf("N[%s]", out)
+ return cache_get_fmt_def(src, "total_per_state" Kfs "R", 15, "%d", "0")
+}
+
+function bar_make_status_procs_count_d( src) {
+ src = "khatus_sensor_procs"
+ return cache_get_fmt_def(src, "total_per_state" Kfs "D", 15, "%d", "0")
+}
+
+function bar_make_status_procs_count_t( src) {
+ src = "khatus_sensor_procs"
+ return cache_get_fmt_def(src, "total_per_state" Kfs "T", 15, "%d", "0")
+}
+
+function bar_make_status_procs_count_i( src) {
+ src = "khatus_sensor_procs"
+ return cache_get_fmt_def(src, "total_per_state" Kfs "I", 15, "%d", "0")