X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/d9877c4bedca550478507f268f43e137e4454c24..434d5f32aa3a19763bf6bb2eed40f881fd918309:/widgets/pulseaudio.lua?ds=inline diff --git a/widgets/pulseaudio.lua b/widgets/pulseaudio.lua index 3178dcf..8e89ffd 100644 --- a/widgets/pulseaudio.lua +++ b/widgets/pulseaudio.lua @@ -16,7 +16,7 @@ local setmetatable = setmetatable -- PulseAudio volume -- lain.widgets.pulseaudio -local pulseaudio = {} +local pulseaudio = helpers.make_widget_textbox() local function worker(args) local args = args or {} @@ -25,7 +25,6 @@ local function worker(args) local scallback = args.scallback pulseaudio.cmd = args.cmd or "pacmd list-sinks | sed -n -e '0,/*/d' -e '/base volume/d' -e '/volume:/p' -e '/muted:/p' -e '/device\\.string/p'" - pulseaudio.widget = wibox.widget.textbox() function pulseaudio.update() if scallback then pulseaudio.cmd = scallback() end @@ -54,7 +53,7 @@ local function worker(args) helpers.newtimer("pulseaudio", timeout, pulseaudio.update) - return setmetatable(pulseaudio, { __index = pulseaudio.widget }) + return pulseaudio end return setmetatable(pulseaudio, { __call = function(_, ...) return worker(...) end })