From eb302f96ff617d76003bd604c7bed6ee1d25a5a4 Mon Sep 17 00:00:00 2001 From: Nolan Prochnau Date: Sat, 2 Jan 2021 20:43:50 -0500 Subject: [PATCH] Add config option for visiblity (#2320 cont'd) (#2342) * Add option * Undo my havoc on the example config * Update CHANGELOG --- CHANGELOG.md | 3 +++ config/config.cmake | 2 ++ include/modules/meta/base.inl | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1336f17a..ee54fa13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - IPC commands to change visibility of modules (`hide.`, `show.`, and `toggle.`) ([`#2108`](https://github.com/polybar/polybar/issues/2108)) +- Config option to hide a certain module + (`hidden = false`) + ([`#2108`](https://github.com/polybar/polybar/issues/2108)) - `internal/xworkspaces`: Make the urgent hint persistent ([`#1081`](https://github.com/polybar/polybar/issues/1081)) diff --git a/config/config.cmake b/config/config.cmake index ce999856..5acd8ce9 100644 --- a/config/config.cmake +++ b/config/config.cmake @@ -274,6 +274,8 @@ format-underline = #0a6cf5 label = %date% %time% +;hidden = true + [module/pulseaudio] type = internal/pulseaudio diff --git a/include/modules/meta/base.inl b/include/modules/meta/base.inl index 9551fa97..608fe67c 100644 --- a/include/modules/meta/base.inl +++ b/include/modules/meta/base.inl @@ -20,7 +20,8 @@ namespace modules { , m_name_raw(name) , m_builder(make_unique(bar)) , m_formatter(make_unique(m_conf, m_name)) - , m_handle_events(m_conf.get(m_name, "handle-events", true)) {} + , m_handle_events(m_conf.get(m_name, "handle-events", true)) + , m_visible(!m_conf.get(m_name, "hidden", false)) {} template module::~module() noexcept {