diff --git a/resources/config b/resources/config index 6d9b7bfd..b9e751ce 100644 --- a/resources/config +++ b/resources/config @@ -24,7 +24,7 @@ // } // }, "sway/mode": { - "format": "{}" + "format": "{}" }, "tray": { // "icon-size": 21, diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 3e2626b6..a9b98b5e 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -136,7 +136,7 @@ auto waybar::modules::Battery::update() -> void } else { event_box_.show(); label_.set_name("battery"); - label_.set_text(fmt::format(format, fmt::arg("capacity", capacity), + label_.set_markup(fmt::format(format, fmt::arg("capacity", capacity), fmt::arg("icon", getIcon(capacity)))); } } diff --git a/src/modules/clock.cpp b/src/modules/clock.cpp index af9dadb3..5cc7459c 100644 --- a/src/modules/clock.cpp +++ b/src/modules/clock.cpp @@ -17,5 +17,5 @@ waybar::modules::Clock::Clock(const Json::Value& config) auto waybar::modules::Clock::update() -> void { auto localtime = fmt::localtime(std::time(nullptr)); - label_.set_text(fmt::format(format_, localtime)); + label_.set_markup(fmt::format(format_, localtime)); } diff --git a/src/modules/cpu.cpp b/src/modules/cpu.cpp index 01a432bb..586bece4 100644 --- a/src/modules/cpu.cpp +++ b/src/modules/cpu.cpp @@ -18,7 +18,7 @@ auto waybar::modules::Cpu::update() -> void auto cpu_load = getCpuLoad(); auto [cpu_usage, tooltip] = getCpuUsage(); label_.set_tooltip_text(tooltip); - label_.set_text(fmt::format(format_, + label_.set_markup(fmt::format(format_, fmt::arg("load", cpu_load), fmt::arg("usage", cpu_usage))); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; diff --git a/src/modules/custom.cpp b/src/modules/custom.cpp index 822d4b0a..a00459b7 100644 --- a/src/modules/custom.cpp +++ b/src/modules/custom.cpp @@ -80,7 +80,7 @@ auto waybar::modules::Custom::update() -> void } auto str = fmt::format(format_, text_); - label_.set_text(str); + label_.set_markup(str); if (text_ == tooltip_) { label_.set_tooltip_text(str); } else { diff --git a/src/modules/memory.cpp b/src/modules/memory.cpp index 38307edf..3464cd7c 100644 --- a/src/modules/memory.cpp +++ b/src/modules/memory.cpp @@ -15,7 +15,7 @@ auto waybar::modules::Memory::update() -> void parseMeminfo(); if (memtotal_ > 0 && memfree_ >= 0) { int used_ram_percentage = 100 * (memtotal_ - memfree_) / memtotal_; - label_.set_text(fmt::format(format_, used_ram_percentage)); + label_.set_markup(fmt::format(format_, used_ram_percentage)); auto used_ram_gigabytes = (memtotal_ - memfree_) / std::pow(1024, 2); label_.set_tooltip_text(fmt::format("{:.{}f}Gb used", used_ram_gigabytes, 1)); label_.set_name("memory"); diff --git a/src/modules/network.cpp b/src/modules/network.cpp index a4fefa17..08901ae0 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -112,7 +112,7 @@ auto waybar::modules::Network::update() -> void } label_.get_style_context()->remove_class("disconnected"); } - label_.set_text(fmt::format(format, + label_.set_markup(fmt::format(format, fmt::arg("essid", essid_), fmt::arg("signaldBm", signal_strength_dbm_), fmt::arg("signalStrength", signal_strength_), diff --git a/src/modules/sway/mode.cpp b/src/modules/sway/mode.cpp index a32f31b8..3bb99241 100644 --- a/src/modules/sway/mode.cpp +++ b/src/modules/sway/mode.cpp @@ -36,7 +36,7 @@ auto waybar::modules::sway::Mode::update() -> void label_.hide(); } else { label_.set_name("mode"); - label_.set_text(fmt::format(format_, mode_)); + label_.set_markup(fmt::format(format_, mode_)); label_.set_tooltip_text(mode_); label_.show(); } diff --git a/src/modules/sway/window.cpp b/src/modules/sway/window.cpp index b908c9e2..fb6132a2 100644 --- a/src/modules/sway/window.cpp +++ b/src/modules/sway/window.cpp @@ -43,7 +43,7 @@ void waybar::modules::sway::Window::worker() auto waybar::modules::sway::Window::update() -> void { - label_.set_text(fmt::format(format_, window_)); + label_.set_markup(fmt::format(format_, window_)); label_.set_tooltip_text(window_); }