Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
- -- This will become dev_before in the next update/iteration
- net.devices[dev] = dev_now
+ if wifi_state == "on" and helpers.first_line(string.format("/sys/class/net/%s/uevent", dev)) == "DEVTYPE=wlan" and string.match(dev_now.carrier, "1") then
+ dev_now.wifi = true
+ dev_now.signal = tonumber(string.match(helpers.lines_from("/proc/net/wireless")[3], "(%-%d+%.)")) or nil
+ end
- total_t = total_t + now_t
- total_r = total_r + now_r
+ if eth_state == "on" and helpers.first_line(string.format("/sys/class/net/%s/uevent", dev)) ~= "DEVTYPE=wlan" and string.match(dev_now.carrier, "1") then
+ dev_now.ethernet = true
+ end
- -- Notify only once when connection is loss
+ net.devices[dev] = dev_now
+
+ -- Notify only once when connection is lost
if string.match(dev_now.carrier, "0") and notify == "on" and helpers.get_map(dev) then
if string.match(dev_now.carrier, "0") and notify == "on" and helpers.get_map(dev) then
- naughty.notify({
+ naughty.notify{
title = dev,
title = dev,
- text = "no carrier",
+ text = "No carrier",
icon = helpers.icons_dir .. "no_net.png",
screen = screen
icon = helpers.icons_dir .. "no_net.png",
screen = screen
- })
+ }
helpers.set_map(dev, false)
elseif string.match(dev_now.carrier, "1") then
helpers.set_map(dev, true)
end
helpers.set_map(dev, false)
elseif string.match(dev_now.carrier, "1") then
helpers.set_map(dev, true)
end
- net_now.carrier = dev_now.carrier
- net_now.state = dev_now.state
+ net_now.carrier = dev_now.carrier
+ net_now.state = dev_now.state
net_now.devices[dev] = dev_now
net_now.devices[dev] = dev_now
- -- new_now.sent and net_now.received will be the
- -- totals across all specified devices
+ -- net_now.sent and net_now.received will be
+ -- the totals across all specified devices
end
end
- if total_t ~= net.last_t or total_r ~= net.last_r then