From 5e1d1e0d47de8fdefb12ce5f45565a39b666e33a Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Thu, 18 Feb 2010 21:42:09 +0100 Subject: [PATCH] volume: suggest appending card ID or other options Widget type takes the mixer control as an argument, i.e. "PCM" but can take optional amixer options, i.e. "PCM -c 1". --- README | 3 ++- volume.lua | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README b/README index 588201e..82b4587 100644 --- a/README +++ b/README @@ -264,7 +264,8 @@ vicious.widgets.mpd vicious.widgets.volume - provides volume levels of requested ALSA mixers - - takes the ALSA channel as an argument, i.e. "Master" + - takes the ALSA mixer control as an argument, i.e. "Master", + optionally append the card ID or other options, i.e. "PCM -c 0" - returns 1st value as the volume level of the requested channel vicious.widgets.weather diff --git a/volume.lua b/volume.lua index 8e65d0e..37303c9 100644 --- a/volume.lua +++ b/volume.lua @@ -19,9 +19,9 @@ module("vicious.volume") -- {{{ Volume widget type -local function worker(format, channel) - -- Get mixer data - local f = io.popen("amixer get " .. channel) +local function worker(format, warg) + -- Get mixer control contents + local f = io.popen("amixer get " .. warg) local mixer = f:read("*all") f:close()