X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/3afe2d54690edf4474a80fa212d9b3819dc716ce..e418d9fb86e95043a678c207f0ca212c98341469:/widgets/alsabar.lua diff --git a/widgets/alsabar.lua b/widgets/alsabar.lua index 2cf1c29..f504cc0 100644 --- a/widgets/alsabar.lua +++ b/widgets/alsabar.lua @@ -15,6 +15,7 @@ local naughty = require("naughty") local io = { popen = io.popen } local math = { modf = math.modf } +local mouse = mouse local string = { format = string.format, match = string.match, rep = string.rep } @@ -75,6 +76,10 @@ function alsabar.notify() .. string.rep(" ", alsabar.notifications.bar_size - int) .. "]" + if alsabar.followmouse then + preset.screen = mouse.screen + end + if alsabar._notify ~= nil then alsabar._notify = naughty.notify ({ replaces_id = alsabar._notify.id, @@ -102,6 +107,7 @@ local function worker(args) alsabar.step = args.step or alsabar.step alsabar.colors = args.colors or alsabar.colors alsabar.notifications = args.notifications or alsabar.notifications + alsabar.followmouse = args.followmouse or false alsabar.bar = awful.widget.progressbar() @@ -117,7 +123,7 @@ local function worker(args) function alsabar.update() -- Get mixer control contents local f = assert(io.popen(string.format("%s get %s", alsabar.cmd, alsabar.channel))) - local mixer = f:read("*a") + local mixer = f:read("*all") f:close() -- Capture mixer control state: [5%] ... ... [on]