X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/a5d68067cfa5759bf55576784563092b5ca5629f..c2b186467c679338417b6f282f9f115ae6860716:/widget/pulseaudio.lua?ds=sidebyside diff --git a/widget/pulseaudio.lua b/widget/pulseaudio.lua index b0946a1..f9a2302 100644 --- a/widget/pulseaudio.lua +++ b/widget/pulseaudio.lua @@ -1,9 +1,8 @@ - --[[ - - Licensed under GNU General Public License v2 - * (c) 2016, Luke Bonham - + + Licensed under GNU General Public License v2 + * (c) 2016, Luke Bonham + --]] local helpers = require("lain.helpers") @@ -17,15 +16,15 @@ local string = { gmatch = string.gmatch, -- lain.widget.pulseaudio local function factory(args) - local pulseaudio = { widget = wibox.widget.textbox() } + local pulseaudio = { widget = wibox.widget.textbox() } local args = args or {} local timeout = args.timeout or 5 local settings = args.settings or function() end local scallback = args.scallback - + pulseaudio.device = "N/A" pulseaudio.devicetype = args.devicetype or "sink" - pulseaudio.cmd = args.cmd or "pacmd list-" .. pulseaudio.devicetype .. "s | sed -n -e '0,/*/d' -e '/base volume/d' -e '/volume:/p' -e '/muted:/p' -e '/device\\.string/p'" + pulseaudio.cmd = args.cmd or "pacmd list-" .. pulseaudio.devicetype .. "s | sed -n -e '/*/,$!d' -e '/index/p' -e '/base volume/d' -e '/volume:/p' -e '/muted:/p' -e '/device\\.string/p'" function pulseaudio.update() if scallback then pulseaudio.cmd = scallback() end