diff options
Diffstat (limited to 'awesome/widgets/pavolctld.lua')
-rw-r--r-- | awesome/widgets/pavolctld.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/awesome/widgets/pavolctld.lua b/awesome/widgets/pavolctld.lua index 33b03d8..f59b27f 100644 --- a/awesome/widgets/pavolctld.lua +++ b/awesome/widgets/pavolctld.lua @@ -23,7 +23,7 @@ local stdin = p:get_stdin_pipe() -- state vars local sinks = { default = nil, - current = nil, -- sink being modified by commands + command = nil, -- sink being modified by commands sinks = {}, } @@ -71,6 +71,8 @@ awful.spawn.read_lines(stdout, function(s) local f = tonumber(s:sub(2)) sinks.default = sinks.get(f) widget.textbox:set_text(sinks.default.vol) + -- set command sink to default sink for now TODO change later + pavolctld_cmd("s") -- sink removed elseif cmd == 'x' then local x = tonumber(s:sub(2)) @@ -78,8 +80,8 @@ awful.spawn.read_lines(stdout, function(s) else naughty.notify({ preset = naughty.config.presets.critical, - title = "pavolctld output error", - text = "pavolctld output data '" .. s .. "' is not recognized as a valid input" + title = "pavolctld error", + text = s }) end end) @@ -95,5 +97,8 @@ end function widget.volume_inc(vol) return pavolctld_cmd("v+" .. vol) end function widget.volume_dec(vol) return pavolctld_cmd("v-" .. vol) end function widget.volume_set(vol) return pavolctld_cmd("v" .. vol) end +function widget.mute_set(muted) return pavolctld_cmd("m" .. muted and 1 or 0) end +function widget.mute_toggle() return pavolctld_cmd("m") end +function widget.default_sink_set(i) return pavolctld_cmd("f" .. i) end return widget |