feat(pulseaudio): define reverse-scroll option (#2664)

* pulseaudio: define reverse-scroll option

When we enable natural scrolling option in libinput,
it sends scroll down event when we swipe up on the touchpad.
This makes the pulseaudio module feel weird.
This option fixes that.

* Update CHANGELOG.md

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
This commit is contained in:
Farseen 2022-04-03 03:15:54 +05:30 committed by GitHub
parent 36d19d372d
commit a2c1392c12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Breaking
- `custom/script` now doesn't hide failing script if it's output is not changing ([`#2636`](https://github.com/polybar/polybar/issues/2636)). Somewhat similar behaviour can be imitated with `format-fail`, if necessary.
### Added
- `internal/pulseaudio`: `reverse-scroll` option ([`#2664`](https://github.com/polybar/polybar/pull/2664))
## [3.6.1] - 2022-03-05
### Build
- Fixed compiler warning in Clang 13 ([`#2613`](https://github.com/polybar/polybar/pull/2613))

View File

@ -53,6 +53,7 @@ namespace modules {
atomic<bool> m_muted{false};
atomic<int> m_volume{0};
atomic<double> m_decibels{0};
atomic<bool> m_reverse_scroll{false};
};
} // namespace modules

View File

@ -26,6 +26,7 @@ namespace modules {
auto sink_name = m_conf.get(name(), "sink", ""s);
bool m_max_volume = m_conf.get(name(), "use-ui-max", true);
m_reverse_scroll = m_conf.get(name(), "reverse-scroll", false);
try {
m_pulseaudio = std::make_unique<pulseaudio>(m_log, move(sink_name), m_max_volume);
@ -124,8 +125,13 @@ namespace modules {
}
m_builder->action(mousebtn::LEFT, *this, EVENT_TOGGLE, "");
m_builder->action(mousebtn::SCROLL_UP, *this, EVENT_INC, "");
m_builder->action(mousebtn::SCROLL_DOWN, *this, EVENT_DEC, "");
if (!m_reverse_scroll) {
m_builder->action(mousebtn::SCROLL_UP, *this, EVENT_INC, "");
m_builder->action(mousebtn::SCROLL_DOWN, *this, EVENT_DEC, "");
} else {
m_builder->action(mousebtn::SCROLL_UP, *this, EVENT_DEC, "");
m_builder->action(mousebtn::SCROLL_DOWN, *this, EVENT_INC, "");
}
}
m_builder->append(output);