summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2021-10-01 00:59:52 +0200
committerache <ache@ache.one>2021-10-01 00:59:52 +0200
commit5cdf77478cceb43873ecb8569a548092cc4c052b (patch)
treec7bc28952ca21b6ff48bca82a76a98d9f0ca358e
parentAdd uselessfair (diff)
Fix Wifi info
-rw-r--r--rc.lua17
1 files changed, 8 insertions, 9 deletions
diff --git a/rc.lua b/rc.lua
index 13c6643..dd1d535 100644
--- a/rc.lua
+++ b/rc.lua
@@ -392,7 +392,8 @@ function act()
function(essid, stderr2, reason2, exit_code2)
if essid ~= "" then
essid = string.gsub(essid, "\n", "")
- toShow = toShow .. " \"" .. essid .. "\" on " .. interface_wifi
+ toShow = toShow .. " [" .. essid .. "]"
+ mynetworkwidget:set_text ( toShow )
if essid ~= lastEssid then
naughty.notify({ preset = naughty.config.presets.normal,
@@ -402,17 +403,15 @@ function act()
lastEssid = essid
end
- awful.spawn.easy_async("bash -c \"iwconfig 2>&1 | grep -v 'no wireless' | grep Signal | cut -d'=' -f 3 | cut -d' ' -f 1\"",
+ awful.spawn.easy_async("bash -c \"iwconfig wlan0 2>&1 | grep -i quality | grep -v 'no wireless' | cut -d'=' -f 2 | cut -d' ' -f1\"",
function(signal, stderr3, reason3, exit_code3)
- signal = string.gsub(signal, "\n", "")
- awful.spawn.easy_async("bash -c \"ip a s " .. interface_wifi .. " | grep 'inet ' | cut -d' ' -f 6\"",
- function(ip_wifi, stderr, reason, exit_code)
- ip_wifi = string.gsub(ip_wifi, "\n", "")
- toShow = toShow .. " #" .. signal .. " " .. ip_wifi
- end)
+ if signal ~= "" then
+ signal = string.gsub(signal, "\n", "")
+ toShow = toShow .. "(" .. signal .. ")"
+ mynetworkwidget:set_text ( toShow )
+ end
end
)
- mynetworkwidget:set_text ( toShow )
end
end
)