X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/a23bd7d49bce2e04dba9f31b6c5d47c0cd36b428..9f6c36adbae22c35ccb779254ddb967c1f5e547d:/widgets/alsa.lua diff --git a/widgets/alsa.lua b/widgets/alsa.lua index f62a150..5a4335e 100644 --- a/widgets/alsa.lua +++ b/widgets/alsa.lua @@ -12,7 +12,8 @@ local newtimer = require("lain.helpers").newtimer local wibox = require("wibox") local io = { popen = io.popen } -local string = { match = string.match } +local string = { match = string.match, + format = string.format } local setmetatable = setmetatable @@ -22,6 +23,7 @@ local alsa = {} local function worker(args) local args = args or {} + local card = args.card or "0" local timeout = args.timeout or 5 local channel = args.channel or "Master" local settings = args.settings or function() end @@ -29,7 +31,7 @@ local function worker(args) alsa.widget = wibox.widget.textbox('') function alsa.update() - local f = assert(io.popen('amixer -M get ' .. channel)) + local f = assert(io.popen(string.format("amixer -c %s -M get %s", card, channel))) local mixer = f:read("*a") f:close()