home
/
code
/
khatus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix wifi link status
[khatus.git]
/
x2
/
src
/
awk
/
exe
/
bar.awk
diff --git
a/x2/src/awk/exe/bar.awk
b/x2/src/awk/exe/bar.awk
index
6fd5a93
..
294dc45
100644
(file)
--- a/
x2/src/awk/exe/bar.awk
+++ b/
x2/src/awk/exe/bar.awk
@@
-152,9
+152,19
@@
function bar_make_status_disk_io_r( src) {
# Network
# -----------------------------------------------------------------------------
# Network
# -----------------------------------------------------------------------------
+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"] == 1)
+ return "<>"
+ else
+ return "--"
+}
+
function bar_make_status_net_addr(interface, src) {
src = "khatus_sensor_net_addr_io"
function bar_make_status_net_addr(interface, src) {
src = "khatus_sensor_net_addr_io"
- return cache_get_fmt_def(src, "addr" Kfs interface, 5, "%s", "")
+ addr = cache_get_fmt_def(src, "addr" Kfs interface, 5, "%s")
+ return addr ? addr : "--"
}
function bar_make_status_net_io_w(interface, src) {
}
function bar_make_status_net_io_w(interface, src) {
@@
-172,6
+182,14
@@
function bar_make_status_net_wifi(interface, src) {
return cache_get_fmt_def(src, "status" Kfs interface, 10, "%s")
}
return cache_get_fmt_def(src, "status" Kfs interface, 10, "%s")
}
+function bar_make_status_net_wifi_link(interface, link) {
+ cache_get(link, "khatus_sensor_net_wifi_status", "link" Kfs interface, 10)
+ if (!link["is_expired"] && link["value"] > 0)
+ return sprintf("%d%%", link["value"])
+ else
+ return "--"
+}
+
# -----------------------------------------------------------------------------
# Bluetooth
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Bluetooth
# -----------------------------------------------------------------------------
@@
-200,14
+218,15
@@
function bar_make_status_volume_alsa_device(device, m, l, r, show) {
cache_get(r, "khatus_sensor_volume", "vol_right" Kfs device, 5)
show = "--"
if (!m["is_expired"] && !l["is_expired"] && !r["is_expired"]) {
cache_get(r, "khatus_sensor_volume", "vol_right" Kfs device, 5)
show = "--"
if (!m["is_expired"] && !l["is_expired"] && !r["is_expired"]) {
- if (m["value"] == "yes") {show = "X"}
- else if (m["value"] == "no") {show = l["value"] " " r["value"]}
- else {
+ if (m["value"] == "yes")
+ show = "X"
+ else if (m["value"] == "no")
+ show = l["value"] #" " r["value"]
+ else
msg_out_log_error(\
"bar_make_status_volume_alsa_device: " device ". ", \
"Unexpected value for 'mute' field: " m["value"] \
)
msg_out_log_error(\
"bar_make_status_volume_alsa_device: " device ". ", \
"Unexpected value for 'mute' field: " m["value"] \
)
- }
}
return show
}
}
return show
}
@@
-240,11
+259,11
@@
function bar_make_status_mpd( state, status) {
function bar_make_status_mpd_state_known(symbol, s, song, time, percentage) {
s = "khatus_sensor_mpd"
function bar_make_status_mpd_state_known(symbol, s, song, time, percentage) {
s = "khatus_sensor_mpd"
- song = cache_get_fmt_def(s, "song" , 5, "%s", "?")
+
#
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", "?")
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)
- return sprintf("%s %s %s
%s", symbol, time, percent, song
)
+
#
song = substr(song, 1, Opt_Mpd_Song_Max_Chars)
+ return sprintf("%s %s %s
", symbol, time, percent
)
}
# -----------------------------------------------------------------------------
}
# -----------------------------------------------------------------------------
This page took
0.038254 seconds
and
4
git commands to generate.