Add summary of process state meanings
[khatus.git] / bin / khatus_bar
index 6fa05ba..b8e47e6 100755 (executable)
@@ -45,6 +45,8 @@ $1 == "OK" {
 
 $1 == "OK" && \
 $2 == "khatus_sensor_datetime" {
+    # Code for make_status_bar definition is expected to be passed as an
+    # additional source file, using  -f  flag.
     print_msg_ok("status_bar", make_status_bar())
 }
 
@@ -141,30 +143,6 @@ function cache_maybe_scale(src, key, val,    key_parts) {
 # Status bar
 # -----------------------------------------------------------------------------
 
-function make_status_bar(    position, bar, sep, i, j) {
-    position[++i] = ""
-    position[++i] = make_status_energy()
-    position[++i] = make_status_mem()
-    position[++i] = make_status_procs()
-    position[++i] = make_status_cpu()
-    position[++i] = make_status_disk()
-    position[++i] = make_status_net()
-    position[++i] = make_status_bluetooth()
-    position[++i] = make_status_screen_brightness()
-    position[++i] = make_status_volume()
-    position[++i] = make_status_mpd()
-    position[++i] = make_status_weather()
-    position[++i] = make_status_datetime()
-    position[++i] = ""
-    bar = ""
-    sep = ""
-    for (j = 1; j <= i; j++) {
-        bar = bar sep position[j]
-        sep = " "
-    }
-    return bar
-}
-
 function make_status_energy(    state, charge, direction_of_change) {
     cache_get(state , "khatus_sensor_energy", "battery_state"     , 0)
     cache_get(charge, "khatus_sensor_energy", "battery_percentage", 0)
@@ -197,6 +175,19 @@ function make_status_mem(    total, used, percent, status) {
 }
 
 function make_status_procs() {
+    # From man ps:
+    #   D    uninterruptible sleep (usually IO)
+    #   R    running or runnable (on run queue)
+    #   S    interruptible sleep (waiting for an event to complete)
+    #   T    stopped by job control signal
+    #   t    stopped by debugger during the tracing
+    #   W    paging (not valid since the 2.6.xx kernel)
+    #   X    dead (should never be seen)
+    #   Z    defunct ("zombie") process, terminated but not reaped by its parent
+    #
+    # Additionally, not documented in ps man page:
+    #   I    Idle
+    #
     src = "khatus_sensor_procs"
     all = cache_get_fmt_def(src, "total_procs"            , 15, "%d")
     r   = cache_get_fmt_def(src, "total_per_state" Kfs "R", 15, "%d", "0")
This page took 0.034715 seconds and 4 git commands to generate.