From: copycat-killer Date: Fri, 28 Oct 2016 11:44:47 +0000 (+0200) Subject: pulseaudio: added sink name; fixed typo; #234 X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/42424334b26f3d8cea288663f67393545d27bafe?ds=sidebyside;hp=-c pulseaudio: added sink name; fixed typo; #234 --- 42424334b26f3d8cea288663f67393545d27bafe diff --git a/widgets/pulseaudio.lua b/widgets/pulseaudio.lua index 4bda3c5..15bea8b 100644 --- a/widgets/pulseaudio.lua +++ b/widgets/pulseaudio.lua @@ -26,7 +26,7 @@ local function worker(args) local settings = args.settings or function() end local scallback = args.scallback - pulseaudio.cmd = args.cmd or string.format("pacmd list-sinks | sed -n -e '0,/*/d' -e '/base volume/d' -e '/volume:/p' -e '/muted:/p'") + pulseaudio.cmd = args.cmd or string.format("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() @@ -34,7 +34,8 @@ local function worker(args) local s = read_pipe(pulseaudio.cmd) volume_now = {} - volume.now.index = string.match(s, "index: (%S+)") or "N/A" + volume_now.index = string.match(s, "index: (%S+)") or "N/A" + volume_now.sink = string.match(s, "device.string = \"(%S+)\"") or "N/A" volume_now.muted = string.match(s, "muted: (%S+)") or "N/A" local ch = 1