aboutsummaryrefslogtreecommitdiff
path: root/wifi.lua
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2009-10-04 00:54:27 +0200
committerAdrian C. (anrxc) <anrxc@sysphere.org>2009-10-04 00:54:27 +0200
commitb4e028b21ffb5b8ee384516626345cf8150dcc02 (patch)
tree389b6d74effbf63ece80661f11ed83f32f439a7e /wifi.lua
parentb65d5093803ec81f89f286c90807a44fa219c733 (diff)
downloadvicious-legacy-b4e028b21ffb5b8ee384516626345cf8150dcc02.tar.xz
Removed some useless else statements
Diffstat (limited to 'wifi.lua')
-rw-r--r--wifi.lua34
1 files changed, 17 insertions, 17 deletions
diff --git a/wifi.lua b/wifi.lua
index 0a57827..4ef9c00 100644
--- a/wifi.lua
+++ b/wifi.lua
@@ -38,25 +38,25 @@ local function worker(format, iface)
-- interface is not a wireless one
if iw == nil or string.find(iw, "No such device") then
return winfo
- else
- -- The output differs from system to system, some stats can
- -- be separated by =, and not all drivers report all stats
- winfo["{ssid}"] = -- SSID can have almost anything in it
- string.match(iw, 'ESSID[=:]"([%w%p]+[%s]*[%w%p]*]*)"') or winfo["{ssid}"]
- winfo["{mode}"] = -- Modes are simple, but also match the "-" in Ad-Hoc
- string.match(iw, "Mode[=:]([%w%-]*)") or winfo["{mode}"]
- winfo["{chan}"] = -- Channels are plain digits
- string.match(iw, "Channel[=:]([%d]+)") or winfo["{chan}"]
- winfo["{rate}"] = -- Bitrate can start with a space and we want to display Mb/s
- string.match(iw, "Bit Rate[=:]([%s]?[%d%.]*[%s][%/%a]+)") or winfo["{rate}"]
--- winfo["{link}"] = -- Link quality can contain a slash: 32/100
--- string.match(iw, "Link Quality[=:]([%d]+[%/%d]*)") or winfo["{link}"]
- winfo["{link}"] = -- * match only the first number, great data for a progressbar
- string.match(iw, "Link Quality[=:]([%d]+)") or winfo["{link}"]
- winfo["{sign}"] = -- Signal level can be a negative value, also display decibel notation
- string.match(iw, "Signal level[=:]([%-%d]+[%s][%a]*)") or winfo["{sign}"]
end
+ -- The output differs from system to system, some stats can
+ -- be separated by =, and not all drivers report all stats
+ winfo["{ssid}"] = -- SSID can have almost anything in it
+ string.match(iw, 'ESSID[=:]"([%w%p]+[%s]*[%w%p]*]*)"') or winfo["{ssid}"]
+ winfo["{mode}"] = -- Modes are simple, but also match the "-" in Ad-Hoc
+ string.match(iw, "Mode[=:]([%w%-]*)") or winfo["{mode}"]
+ winfo["{chan}"] = -- Channels are plain digits
+ string.match(iw, "Channel[=:]([%d]+)") or winfo["{chan}"]
+ winfo["{rate}"] = -- Bitrate can start with a space and we want to display Mb/s
+ string.match(iw, "Bit Rate[=:]([%s]?[%d%.]*[%s][%/%a]+)") or winfo["{rate}"]
+-- winfo["{link}"] = -- Link quality can contain a slash: 32/100
+-- string.match(iw, "Link Quality[=:]([%d]+[%/%d]*)") or winfo["{link}"]
+ winfo["{link}"] = -- * match only the first number, great data for a progressbar
+ string.match(iw, "Link Quality[=:]([%d]+)") or winfo["{link}"]
+ winfo["{sign}"] = -- Signal level can be a negative value, also display decibel notation
+ string.match(iw, "Signal level[=:]([%-%d]+[%s][%a]*)") or winfo["{sign}"]
+
return winfo
end
-- }}}