]> git.madduck.net Git - etc/awesome.git/blobdiff - widget/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:

pull #307: worker -> factory
[etc/awesome.git] / widget / net.lua
index c6ebaca9d5a9616b9da71e5fb4d489a04bddb206..a4b8c34b014bca2e31ce1bc5939acfc4a67d613a 100644 (file)
@@ -7,17 +7,16 @@
                                                   
 --]]
 
-local helpers      = require("lain.helpers")
-local naughty      = require("naughty")
-local wibox        = require("wibox")
-local string       = { format = string.format,
-                       match  = string.match }
-local setmetatable = setmetatable
+local helpers = require("lain.helpers")
+local naughty = require("naughty")
+local wibox   = require("wibox")
+local string  = { format = string.format,
+                  match  = string.match }
 
 -- Network infos
 -- lain.widget.net
 
-local function worker(args)
+local function factory(args)
     local net = { widget = wibox.widget.textbox() }
     net.last_t = 0
     net.last_r = 0
@@ -120,4 +119,4 @@ local function worker(args)
     return net
 end
 
-return setmetatable({}, { __call = function(_, ...) return worker(...) end })
+return factory