From e21df5ae362244843607f198faf19f8acea46293 Mon Sep 17 00:00:00 2001 From: Robinhuett <5955614+Robinhuett@users.noreply.github.com> Date: Fri, 9 Nov 2018 22:48:27 +0100 Subject: [PATCH] Add config option for volume change scroll step size --- resources/config | 1 + src/modules/pulseaudio.cpp | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/config b/resources/config index 671a757..5bbeddf 100644 --- a/resources/config +++ b/resources/config @@ -63,6 +63,7 @@ "format-disconnected": "Disconnected ⚠" }, "pulseaudio": { + //"scroll-step": 1, "format": "{volume}% {icon}", "format-bluetooth": "{volume}% {icon}", "format-muted": "", diff --git a/src/modules/pulseaudio.cpp b/src/modules/pulseaudio.cpp index 3614c98..aaa7fcc 100644 --- a/src/modules/pulseaudio.cpp +++ b/src/modules/pulseaudio.cpp @@ -74,8 +74,7 @@ void waybar::modules::Pulseaudio::contextStateCb(pa_context *c, void *data) bool waybar::modules::Pulseaudio::handleScroll(GdkEventScroll *e) { // Avoid concurrent scroll event bool direction_up = false; - // XXX/TODO: Change of 100 corresponds to 1%, does that always hold true? - uint16_t change = 100; + uint16_t change = config_["scroll-step"].isUInt() ? config_["scroll-step"].asUInt() * 100 : 100; pa_cvolume pa_volume = pa_volume_; if (scrolling_) {