From: Siraaj Khandkar Date: Wed, 6 Mar 2019 11:23:19 +0000 (-0500) Subject: Add method for wifi link strength only X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=daf7f29d0b4bc4aaf031fe9577ddfbe3ff4c316c;p=khatus.git Add method for wifi link strength only --- diff --git a/x2/sanity_check b/x2/sanity_check index 9604f6f..fad813b 100755 --- a/x2/sanity_check +++ b/x2/sanity_check @@ -10,8 +10,8 @@ -v Opt_Pulseaudio_Sink=0 \ -v GC_Interval=300 \ -f <(./bin/khatus_gen_bar_make_status \ - -v Status_Fmt=' E=%s%% M=%d%% P=[%s %sr %sd %st %si %sz] C=[%s %s°C %srpm] D=[%s%% %s▲ %s▼] W=[%s %s▲ %s▼] E:%s:%s B=%s *=%s%% (%s) [%s] %s°F %s ' \ - -v Status_Args='@energy_percent,@memory_percent,@processes_count_all,@processes_count_r,@processes_count_d,@processes_count_t,@processes_count_i,@processes_count_z,@cpu_loadavg,@cpu_temp,@cpu_fan_speed,@disk_space,@disk_io_w,@disk_io_r,@net_wifi:wlp4s0,@net_io_w:wlp4s0,@net_io_r:wlp4s0,@net_iface_status:enp0s31f6,@net_addr:enp0s31f6,@bluetooth_power,@backlight_percent,@volume:0,@mpd,@weather_temp_f,@datetime' \ + -v Status_Fmt=' E=%s%% M=%d%% P=[%s %sr %sd %st %si %sz] C=[%s %s°C %srpm] D=[%s%% %s▲ %s▼] W=[%s %s %s▲ %s▼] E:%s:%s B=%s *=%s%% (%s) [%s] %s°F %s ' \ + -v Status_Args='@energy_percent,@memory_percent,@processes_count_all,@processes_count_r,@processes_count_d,@processes_count_t,@processes_count_i,@processes_count_z,@cpu_loadavg,@cpu_temp,@cpu_fan_speed,@disk_space,@disk_io_w,@disk_io_r,@net_wifi_link:wlp4s0,@net_wifi:wlp4s0,@net_io_w:wlp4s0,@net_io_r:wlp4s0,@net_iface_status:enp0s31f6,@net_addr:enp0s31f6,@bluetooth_power,@backlight_percent,@volume:0,@mpd,@weather_temp_f,@datetime' \ ) \ ) \ >(stdbuf -o L ./bin/khatus_monitor_energy) \ diff --git a/x2/src/awk/exe/bar.awk b/x2/src/awk/exe/bar.awk index 9b7328c..84f0ada 100644 --- a/x2/src/awk/exe/bar.awk +++ b/x2/src/awk/exe/bar.awk @@ -182,6 +182,11 @@ function bar_make_status_net_wifi(interface, src) { return cache_get_fmt_def(src, "status" Kfs interface, 10, "%s") } +function bar_make_status_net_wifi_link(interface, src) { + src = "khatus_sensor_net_wifi_status" + return cache_get_fmt_def(src, "link" Kfs interface, 10, "%d%%") +} + # ----------------------------------------------------------------------------- # Bluetooth # ----------------------------------------------------------------------------- diff --git a/x2/src/awk/exe/gen_bar_make_status.awk b/x2/src/awk/exe/gen_bar_make_status.awk index 587b102..2cad533 100644 --- a/x2/src/awk/exe/gen_bar_make_status.awk +++ b/x2/src/awk/exe/gen_bar_make_status.awk @@ -29,6 +29,8 @@ BEGIN { params["@net_io_r"] = 1 aliases["@net_wifi"] = "bar_make_status_net_wifi(\"%s\")" params["@net_wifi"] = 1 + aliases["@net_wifi_link"] = "bar_make_status_net_wifi_link(\"%s\")" + params["@net_wifi_link"] = 1 aliases["@net_iface_status"] = "bar_make_status_net_iface_status(\"%s\")" params["@net_iface_status"] = 1 diff --git a/x2/src/awk/exe/parse_iwconfig.awk b/x2/src/awk/exe/parse_iwconfig.awk index 8af18bd..d454578 100644 --- a/x2/src/awk/exe/parse_iwconfig.awk +++ b/x2/src/awk/exe/parse_iwconfig.awk @@ -30,6 +30,7 @@ END { i = requested_interface - status = link[i] ? sprintf("%s:%d%%", essid[i], link[i]) : "--" - print("status" Kfs i, status) + print("status" Kfs i, link[i] ? sprintf("%s:%d%%", essid[i], link[i]) : "--") + print("essid" Kfs i, link[i] ? essid[i] : "--") + print("link" Kfs i, link[i] ? link[i] : "--") }