mirror of
https://github.com/polybar/polybar.git
synced 2026-03-01 21:58:53 +00:00
feat(network): Ability to change speed unit text (B/s) (#2068)
New config option `speed-unit = B/s` will be used to suffix the upload and download speeds. * mod::network: udspeed-unit to set network speed unit suffix * Changed udspeed-unit to speed-unit
This commit is contained in:
@ -21,6 +21,7 @@ namespace modules {
|
||||
m_accumulate = m_conf.get(name(), "accumulate-stats", m_accumulate);
|
||||
m_interval = m_conf.get<decltype(m_interval)>(name(), "interval", 1s);
|
||||
m_unknown_up = m_conf.get<bool>(name(), "unknown-as-up", false);
|
||||
m_udspeed_unit = m_conf.get<string>(name(), "speed-unit", m_udspeed_unit);
|
||||
|
||||
m_conf.warn_deprecated(name(), "udspeed-minwidth", "%downspeed:min:max% and %upspeed:min:max%");
|
||||
|
||||
@ -109,8 +110,8 @@ namespace modules {
|
||||
m_counter = 0;
|
||||
}
|
||||
|
||||
auto upspeed = network->upspeed(m_udspeed_minwidth);
|
||||
auto downspeed = network->downspeed(m_udspeed_minwidth);
|
||||
auto upspeed = network->upspeed(m_udspeed_minwidth, m_udspeed_unit);
|
||||
auto downspeed = network->downspeed(m_udspeed_minwidth, m_udspeed_unit);
|
||||
|
||||
// Update label contents
|
||||
const auto replace_tokens = [&](label_t& label) {
|
||||
|
||||
Reference in New Issue
Block a user