From 4bc30e040f7c459c6378f6fbdcaba2dcfd55fd0c Mon Sep 17 00:00:00 2001 From: Finlay Davidson Date: Wed, 10 May 2023 13:43:43 +0200 Subject: [PATCH] mpris: Hide label if empty --- src/modules/mpris/mpris.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/mpris/mpris.cpp b/src/modules/mpris/mpris.cpp index e89b8ef..e434694 100644 --- a/src/modules/mpris/mpris.cpp +++ b/src/modules/mpris/mpris.cpp @@ -630,7 +630,12 @@ auto Mpris::update() -> void { fmt::arg("player_icon", getIconFromJson(config_["player-icons"], info.name)), fmt::arg("status_icon", getIconFromJson(config_["status-icons"], info.status_string))); - label_.set_markup(label_format); + if (label_format.empty()) { + label_.hide(); + } else { + label_.set_markup(label_format); + label_.show(); + } } catch (fmt::format_error const& e) { spdlog::warn("mpris: format error: {}", e.what()); }