diff options
-rw-r--r-- | awesome/todo | 5 | ||||
-rw-r--r-- | awesome/widgets/pavolctld.lua | 11 |
2 files changed, 10 insertions, 6 deletions
diff --git a/awesome/todo b/awesome/todo index 70b1646..346ddd8 100644 --- a/awesome/todo +++ b/awesome/todo @@ -1,10 +1,9 @@ gaps keybinds -client mfact/fact +client mfact/fact keybinds hostname configs -volume widget & dropdown menu +volume dropdown menu battery widget bar styling / powerline for certain confs -net widget classiclayout widget minify widget icons bar title tabs in monocle mode 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 |