Add config option for visiblity (#2320 cont'd) (#2342)

* Add option

* Undo my havoc on the example config

* Update CHANGELOG
This commit is contained in:
Nolan Prochnau 2021-01-02 20:43:50 -05:00 committed by GitHub
parent 412f4c723f
commit eb302f96ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -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.<name>`, `show.<name>`, and `toggle.<name>`)
([`#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))

View File

@ -274,6 +274,8 @@ format-underline = #0a6cf5
label = %date% %time%
;hidden = true
[module/pulseaudio]
type = internal/pulseaudio

View File

@ -20,7 +20,8 @@ namespace modules {
, m_name_raw(name)
, m_builder(make_unique<builder>(bar))
, m_formatter(make_unique<module_formatter>(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 <typename Impl>
module<Impl>::~module() noexcept {