mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
mpris: Hide label if empty
This commit is contained in:
parent
919ad0a8bb
commit
4bc30e040f
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user