diff options
author | ache <ache@ache.one> | 2021-10-01 00:59:52 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2021-10-01 00:59:52 +0200 |
commit | 5cdf77478cceb43873ecb8569a548092cc4c052b (patch) | |
tree | c7bc28952ca21b6ff48bca82a76a98d9f0ca358e | |
parent | Add uselessfair (diff) |
Fix Wifi info
-rw-r--r-- | rc.lua | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -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 ) |