Improve readability of pulseaudio widget code

This commit is contained in:
Calvin Timmer 2017-02-02 14:43:36 +01:00
parent 1f07435219
commit e015d5ec26
1 changed files with 3 additions and 5 deletions

View File

@ -10,15 +10,13 @@ local helpers = require("lain.helpers")
local shell = require("awful.util").shell
local wibox = require("wibox")
local string = { gmatch = string.gmatch,
match = string.match,
format = string.format }
local setmetatable = setmetatable
match = string.match }
-- PulseAudio volume
-- lain.widgets.pulseaudio
local function worker(args)
local function factory(args)
local pulseaudio = {}
local args = args or {}
local timeout = args.timeout or 5
@ -59,4 +57,4 @@ local function worker(args)
return pulseaudio
end
return setmetatable({}, { __call = function(_, ...) return worker(...) end })
return factory