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".
This commit is contained in:
parent
24f23fa072
commit
5e1d1e0d47
3
README
3
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
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue