]>
git.madduck.net Git - etc/awesome.git/blobdiff - widgets/net.lua
madduck's git repository
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.
SSH access, as well as push access can be individually
arranged .
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
["b"] = 1,
["kb"] = 1024,
["mb"] = 1024^2,
["b"] = 1,
["kb"] = 1024,
["mb"] = 1024^2,
local args = args or {}
local iface = args.iface or net.get_device()
local delta = args.refresh_timeout or 2
local args = args or {}
local iface = args.iface or net.get_device()
local delta = args.refresh_timeout or 2
- local unit = args.unit or unit ["kb"]
+ local units = args.units or net.units ["kb"]
local spr = args.spr or " "
local header = args.header or iface
local header_color = args.header_color or beautiful.fg_normal or "#FFFFFF"
local spr = args.spr or " "
local header = args.header or iface
local header_color = args.header_color or beautiful.fg_normal or "#FFFFFF"
- local color_up = args.color_up or beautiful.fg_focus or header_color
- local color_down = args.color_down or beautiful.fg_focus or header_color
+ local color_up = args.color_up or beautiful.fg_focus or "#FFFFFF"
+ local color_down = args.color_down or beautiful.fg_focus or "#FFFFFF"
local app = args.app or "sudo wifi-menu"
helpers.set_map(iface, true)
local app = args.app or "sudo wifi-menu"
helpers.set_map(iface, true)
if net.last_t[iface] and net.last_t[iface]
then
if net.last_t[iface] and net.last_t[iface]
then
- net.send = tostring((now_t - net.last_t[iface]) / delta / unit)
- net.recv = tostring((now_r - net.last_r[iface]) / delta / unit)
+ net.send = tostring((now_t - net.last_t[iface]) / delta / units )
+ net.recv = tostring((now_r - net.last_r[iface]) / delta / units )
text = text
.. '<span color="' .. color_up .. '">'
text = text
.. '<span color="' .. color_up .. '">'