From 41b0043a3f320f76cb9bd129ed3158ef785d743b Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sat, 16 May 2015 13:57:19 +0200 Subject: widgets/volume: use default card --- widgets/volume.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'widgets') diff --git a/widgets/volume.lua b/widgets/volume.lua index 80d170f..a9a6437 100644 --- a/widgets/volume.lua +++ b/widgets/volume.lua @@ -10,12 +10,16 @@ local beautiful = require ("beautiful") module("widgets.volume") -local cardid = 0 +local cardid = nil local channel = "Master" -- command must start with a space! local function mixercommand(w, command) - local fd = io.popen("amixer -c " .. cardid .. command) + cmd = "amixer" + if cardid then + cmd = cmd .. " -c " .. cardid + end + local fd = io.popen(cmd .. command) local status = fd:read("*all") fd:close() local volume = string.match(status, "(%d?%d?%d)%%") -- cgit v1.2.3