Update alignment
[khatus.git] / bin / khatus_bar
index 2a517a1..bd31283 100755 (executable)
@@ -3,7 +3,7 @@
 # Naming convention:
 #     Variables:
 #         - global, builtin : ALLCAPS
-#         - global, public  : CamelCase
+#         - global, public  : Camel_Snake_Man_Bear_Pig
 #         - global, private : _snake_case_prefixed_underscore
 #         - local           : snake_case
 #     Functions:
@@ -199,9 +199,9 @@ function make_status_cpu(    l, t, f) {
 function 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_space, "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")
+    u = cache_get_fmt_def(src_, "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)
 }
 
@@ -222,7 +222,7 @@ function make_status_net(    \
     sep \
 ) {
     number_of_net_interfaces_to_show = \
-        split(opt_net_interfaces_to_show, 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 = ""
@@ -257,11 +257,11 @@ function make_status_screen_brightness(    src, key) {
 }
 
 function make_status_volume(    sink, mu, vl, vr, show) {
-    sink = opt_pulseaudio_sink
+    sink = Opt_Pulseaudio_Sink
     cache_get(mu, "khatus_sensor_volume", "mute"      Kfs sink, 5)
     cache_get(vl, "khatus_sensor_volume", "vol_left"  Kfs sink, 5)
     cache_get(vr, "khatus_sensor_volume", "vol_right" Kfs sink, 5)
-
+    show = "--"
     if (!mu["is_expired"] && !vl["is_expired"] && !vr["is_expired"]) {
              if (mu["value"] == "yes") {show = "X"}
         else if (mu["value"] == "no")  {show = vl["value"] " " vr["value"]}
@@ -271,10 +271,7 @@ function make_status_volume(    sink, mu, vl, vr, show) {
                 "Unexpected value for 'mute' field: " mu["value"] \
             )
         }
-    } else {
-        show = "--"
     }
-
     return sprintf("(%s)", show)
 }
 
@@ -306,7 +303,7 @@ function make_status_mpd_state_known(symbol,    s, song, time, percentage) {
     song    = cache_get_fmt_def(s, "song"                   , 5, "%s", "?")
     time    = cache_get_fmt_def(s, "play_time_minimal_units", 5, "%s", "?")
     percent = cache_get_fmt_def(s, "play_time_percentage"   , 5, "%s", "?")
-    song    = substr(song, 1, opt_mpd_song_max_chars)
+    song    = substr(song, 1, Opt_Mpd_Song_Max_Chars)
     return sprintf("%s %s %s %s", symbol, time, percent, song)
 }
 
This page took 0.029671 seconds and 4 git commands to generate.