diff options
author | Tim Keller <tjk@tjkeller.xyz> | 2024-10-06 20:02:57 -0500 |
---|---|---|
committer | Tim Keller <tjk@tjkeller.xyz> | 2024-10-06 20:02:57 -0500 |
commit | e95dbda434b9b47fab1451e7eda0955093b460f2 (patch) | |
tree | 7c73103dd6e92628a5836934fd2ff888ce4fa378 /awesome/widgets/pavolctld.lua | |
parent | e0ec5e895c787069ed06e02b6c64606b0188cccf (diff) | |
download | dotconfig-e95dbda434b9b47fab1451e7eda0955093b460f2.tar.xz dotconfig-e95dbda434b9b47fab1451e7eda0955093b460f2.zip |
update awesome
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 |