diff --git a/CHANGELOG.md b/CHANGELOG.md index ada85b87..0f3527c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,6 +73,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `DEBUG_SHADED` cmake variable and its associated functionality. ### Added +- Right and middle click events for alsa module. + ([`#2566`](https://github.com/polybar/polybar/issues/2566)) - `internal/network`: New token `%mac%` shows MAC address of selected interface ([`#2568`](https://github.com/polybar/polybar/issues/2568)) - Polybar can now read config files from stdin: `polybar -c /dev/stdin`. diff --git a/src/modules/alsa.cpp b/src/modules/alsa.cpp index 143787c6..88aad7a3 100644 --- a/src/modules/alsa.cpp +++ b/src/modules/alsa.cpp @@ -196,6 +196,17 @@ namespace modules { string output{module::get_output()}; if (m_handle_events) { + auto click_middle = m_conf.get(name(), "click-middle", ""s); + auto click_right = m_conf.get(name(), "click-right", ""s); + + if (!click_middle.empty()) { + m_builder->action(mousebtn::MIDDLE, click_middle); + } + + if (!click_right.empty()) { + m_builder->action(mousebtn::RIGHT, click_right); + } + 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, "");