Conflicts:
	init.lua
	widgets/init.lua
	widgets/volume.lua
This commit is contained in:
Joerg T. (Mic92) 2010-12-18 08:34:04 +01:00
commit 43a3d2585d
2 changed files with 6 additions and 14 deletions

View File

@ -30,7 +30,6 @@ require("vicious.widgets.mpd")
require("vicious.widgets.volume")
require("vicious.widgets.weather")
require("vicious.widgets.date")
-- }}}
-- Vicious: widgets for the awesome window manager

View File

@ -14,7 +14,6 @@ local string = { match = string.match }
-- Volume: provides volume levels and state of requested ALSA mixers
module("vicious.widgets.volume")
local startup = true
-- {{{ Volume widget type
local function worker(format, warg)
@ -25,19 +24,13 @@ local function worker(format, warg)
["off"] = "" -- "M"
}
local volu, mute
if not startup then
-- Get mixer control contents
local f = io.popen("amixer get " .. warg)
local mixer = f:read("*all")
f:close()
-- Capture mixer control state: [5%] ... ... [on]
volu, mute = string.match(mixer, "([%d]+)%%.*%[([%l]*)")
else
startup = false
end
-- Get mixer control contents
local f = io.popen("amixer get " .. warg)
local mixer = f:read("*all")
f:close()
-- Capture mixer control state: [5%] ... ... [on]
local volu, mute = string.match(mixer, "([%d]+)%%.*%[([%l]*)")
-- Handle mixers without data
if volu == nil then
return {0, mixer_state["off"]}