diff --git a/src/client.vala b/src/client.vala index 1d0e39f..6d7a2e2 100644 --- a/src/client.vala +++ b/src/client.vala @@ -62,15 +62,20 @@ private void print_subscribe () { private void on_subscribe_waybar (uint count, bool dnd, bool cc_open) { string state = (dnd ? "dnd-" : "") + (count > 0 ? "notification" : "none"); - if (cc_open) state += " cc-open"; string tooltip = ""; if (count > 0) { tooltip = @"$(count) Notification" + (count > 1 ? "s" : ""); } - print ("{\"text\": \"\", \"alt\": \"%s\", \"tooltip\": \"%s\", \"class\": \"%s\"}\n", - state, tooltip, state); + string _class = @"\"$(state)\""; + if (cc_open) { + _class = @"[$(_class), \"cc-open\"]"; + } + + print ( + "{\"text\": \"\", \"alt\": \"%s\", \"tooltip\": \"%s\", \"class\": %s}\n", + state, tooltip, _class); } private void print_subscribe_waybar () {