mirror of
https://github.com/polybar/polybar.git
synced 2024-11-11 13:50:56 -05:00
feat(pulse): Add click-(middle|right) keys (#1941)
This commit is contained in:
parent
7f09784548
commit
70bf0339b8
1 changed files with 16 additions and 5 deletions
|
@ -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::pulseaudio_module(const bar_settings& bar, string name_) : event_module<pulseaudio_module>(bar, move(name_)) {
|
||||
pulseaudio_module::pulseaudio_module(const bar_settings& bar, string name_)
|
||||
: event_module<pulseaudio_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
|
||||
|
|
Loading…
Reference in a new issue