diff --git a/src/modules/pulseaudio.cpp b/src/modules/pulseaudio.cpp index 8fe066cc..4278e7c2 100644 --- a/src/modules/pulseaudio.cpp +++ b/src/modules/pulseaudio.cpp @@ -1,20 +1,20 @@ #include "modules/pulseaudio.hpp" + #include "adapters/pulseaudio.hpp" #include "drawtypes/label.hpp" #include "drawtypes/progressbar.hpp" #include "drawtypes/ramp.hpp" -#include "utils/math.hpp" - #include "modules/meta/base.inl" - #include "settings.hpp" +#include "utils/math.hpp" POLYBAR_NS namespace modules { template class module; - pulseaudio_module::pulseaudio_module(const bar_settings& bar, string name_) : event_module(bar, move(name_)) { + pulseaudio_module::pulseaudio_module(const bar_settings& bar, string name_) + : event_module(bar, move(name_)) { // Load configuration values m_interval = m_conf.get(name(), "interval", m_interval); @@ -106,6 +106,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->cmd(mousebtn::MIDDLE, click_middle); + } + + if (!click_right.empty()) { + m_builder->cmd(mousebtn::RIGHT, click_right); + } + m_builder->cmd(mousebtn::LEFT, EVENT_TOGGLE_MUTE); m_builder->cmd(mousebtn::SCROLL_UP, EVENT_VOLUME_UP); m_builder->cmd(mousebtn::SCROLL_DOWN, EVENT_VOLUME_DOWN); @@ -157,6 +168,6 @@ namespace modules { return true; } -} +} // namespace modules POLYBAR_NS_END