diff --git a/include/modules/alsa.hpp b/include/modules/alsa.hpp index cb4e851f..f1a1f670 100644 --- a/include/modules/alsa.hpp +++ b/include/modules/alsa.hpp @@ -67,6 +67,7 @@ namespace modules { map m_ctrl; int m_headphoneid{0}; bool m_mapped{false}; + bool m_unmute_on_scroll{false}; int m_interval{5}; atomic m_muted{false}; atomic m_headphones{false}; diff --git a/src/modules/alsa.cpp b/src/modules/alsa.cpp index 94ce7a16..aeb088ac 100644 --- a/src/modules/alsa.cpp +++ b/src/modules/alsa.cpp @@ -28,6 +28,7 @@ namespace modules { // Load configuration values m_mapped = m_conf.get(name(), "mapped", m_mapped); m_interval = m_conf.get(name(), "interval", m_interval); + m_unmute_on_scroll = m_conf.get(name(), "unmute-on-scroll", m_unmute_on_scroll); auto master_mixer_name = m_conf.get(name(), "master-mixer", "Master"s); auto speaker_mixer_name = m_conf.get(name(), "speaker-mixer", ""s); @@ -261,6 +262,9 @@ namespace modules { } const auto& mixers = get_mixers(); for (auto&& mixer : mixers) { + if (m_unmute_on_scroll) { + mixer->set_mute(true); + } m_mapped ? mixer->set_normalized_volume(math_util::cap(mixer->get_normalized_volume() + interval, 0, 100)) : mixer->set_volume(math_util::cap(mixer->get_volume() + interval, 0, 100)); }