diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e61388b..c050b135 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,8 +51,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 repository. - The `POLYBAR_FLAGS` cmake variable can be used to pass extra C++ compiler flags. +### Deprecated +- `[settings]`: `throttle-output` and `throttle-output-for` have been removed. + The new event loop already does a similar thing where it coalesces update + triggers if they happen directly after one another, leading to only a single + bar update. + ### Added -- `internal/memory`: New tokens `%used%`, `%free%`, `%total%`, `%swap_total%`, +- `internal/memory`: New tokens `%used%`, `%free%`, `%total%`, `%swap_total%`, `%swap_free%`, and `%swap_used%` that automatically switch between MiB and GiB when below or above 1GiB. ([`2472`](https://github.com/polybar/polybar/issues/2472)) diff --git a/include/components/config.hpp b/include/components/config.hpp index 77447b46..b052f567 100644 --- a/include/components/config.hpp +++ b/include/components/config.hpp @@ -182,6 +182,8 @@ class config { return default_value; } + void ignore_key(const string& section, const string& key) const; + /** * Attempt to load value using the deprecated key name. If successful show a * warning message. If it fails load the value using the new key and given diff --git a/src/components/config.cpp b/src/components/config.cpp index 5be2c223..49657356 100644 --- a/src/components/config.cpp +++ b/src/components/config.cpp @@ -56,6 +56,12 @@ void config::set_included(file_list included) { m_included = move(included); } +void config::ignore_key(const string& section, const string& key) const { + if (has(section, key)) { + m_log.warn("The config parameter '%s.%s' is deprecated, it will be removed in the future. Please remove it from your config", section, key); + } +} + /** * Print a deprecation warning if the given parameter is set */ diff --git a/src/components/controller.cpp b/src/components/controller.cpp index a19cbb5e..29fd232c 100644 --- a/src/components/controller.cpp +++ b/src/components/controller.cpp @@ -47,15 +47,11 @@ controller::controller(connection& conn, signal_emitter& emitter, const logger& , m_conf(config) , m_bar(forward(bar)) , m_ipc(forward(ipc)) { - if (m_conf.has("settings", "throttle-input-for")) { - m_log.warn( - "The config parameter 'settings.throttle-input-for' is deprecated, it will be removed in the future. Please " - "remove it from your config"); - } - - // TODO deprecate both - m_conf.deprecated("settings", "eventqueue-swallow", "throttle-output", 0); - m_conf.deprecated("settings", "eventqueue-swallow-time", "throttle-output-for", 0); + m_conf.ignore_key("settings", "throttle-input-for"); + m_conf.ignore_key("settings", "throttle-output"); + m_conf.ignore_key("settings", "throttle-output-for"); + m_conf.ignore_key("settings", "eventqueue-swallow"); + m_conf.ignore_key("settings", "eventqueue-swallow-time"); m_log.trace("controller: Setup user-defined modules"); size_t created_modules{0}; diff --git a/src/components/eventloop.cpp b/src/components/eventloop.cpp index 7817a221..6003aa76 100644 --- a/src/components/eventloop.cpp +++ b/src/components/eventloop.cpp @@ -1,5 +1,7 @@ #include "components/eventloop.hpp" +#include + POLYBAR_NS /**