Additional options when muted for the PulseAudio-Slider module:

- Add "muted" class for styling the muted state.
- Add "zero-on-mute" boolean option to control slider position
  when muted.
- Add "unmute-on-volume-change" boolean option to control whether
  to automatically unmute when the volume changes.
This commit is contained in:
finitemonkey
2026-05-17 08:22:17 +01:00
parent 05945748dc
commit 0351ac8fb2
5 changed files with 98 additions and 65 deletions
+10 -6
View File
@@ -6,10 +6,6 @@
#include "util/audio_backend.hpp"
namespace waybar::modules {
enum class PulseaudioSliderTarget {
Sink,
Source,
};
class PulseaudioSlider : public ASlider {
public:
@@ -21,7 +17,15 @@ class PulseaudioSlider : public ASlider {
private:
std::shared_ptr<util::AudioBackend> backend = nullptr;
PulseaudioSliderTarget target = PulseaudioSliderTarget::Sink;
util::PulseaudioTarget target = util::PulseaudioTarget::Sink;
bool zero_on_mute = true;
bool unmute_on_volume_change = true;
// zero_on_mute and unmute_on_volume_change default to true
// in order to maintain previous behaviour when using a
// config in which these values are undefined
bool previously_muted = false;
};
} // namespace waybar::modules
} // namespace waybar::modules