From ff61857e157b8f32e861016a6f151a7d1ddcd2da Mon Sep 17 00:00:00 2001 From: copycat-killer Date: Mon, 23 Jan 2017 15:52:26 +0100 Subject: [PATCH 1/1] alsabar: forgot callback --- widgets/alsabar.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/widgets/alsabar.lua b/widgets/alsabar.lua index 6a03a10..bc8d8d3 100644 --- a/widgets/alsabar.lua +++ b/widgets/alsabar.lua @@ -15,6 +15,7 @@ local math = { modf = math.modf } local string = { format = string.format, match = string.match, rep = string.rep } +local type = type local tonumber = tonumber local setmetatable = setmetatable @@ -68,7 +69,7 @@ local function worker(args) alsabar.tooltip = awful.tooltip({ objects = { alsabar.bar } }) - function alsabar.update() + function alsabar.update(callback) helpers.async(alsabar.cmd, function(mixer) local volu,mute = string.match(mixer, "([%d]+)%%.*%[([%l]*)") if (volu and tonumber(volu) ~= alsabar._current_level) or (mute and string.match(mute, "on") ~= alsabar._muted) then @@ -89,6 +90,8 @@ local function worker(args) volume_now.status = mute settings() + + if type(callback) == "function" then callback() end end end) end -- 2.39.5