From 06c502354f133096c9d6a9bd10353944f028a5a7 Mon Sep 17 00:00:00 2001 From: retrozinndev Date: Wed, 12 Feb 2025 16:39:31 -0300 Subject: [PATCH] :boom: fix(ags/bar): fix FocusedClient widget to update client title and class automatically --- ags/widget/bar/FocusedClient.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ags/widget/bar/FocusedClient.ts b/ags/widget/bar/FocusedClient.ts index 56a02a6..fb9930c 100644 --- a/ags/widget/bar/FocusedClient.ts +++ b/ags/widget/bar/FocusedClient.ts @@ -24,20 +24,20 @@ export function FocusedClient() { orientation: Gtk.Orientation.VERTICAL, homogeneous: false, valign: Gtk.Align.CENTER, - children: [ - new Widget.Label({ - className: "class", - xalign: 0, - label: bind(hyprland, "focusedClient").as((client: AstalHyprland.Client) => - client ? client.class : "") - } as Widget.LabelProps), - new Widget.Label({ - className: "title", - xalign: 0, - label: bind(hyprland, "focusedClient").as((client: AstalHyprland.Client) => - client ? client.title : "") - } as Widget.LabelProps) - ] + children: bind(hyprland, "focusedClient").as((focusedClient: AstalHyprland.Client) => + focusedClient ? [ + new Widget.Label({ + className: "class", + xalign: 0, + label: bind(focusedClient, "class") + } as Widget.LabelProps), + new Widget.Label({ + className: "title", + xalign: 0, + label: bind(focusedClient, "title") + } as Widget.LabelProps) + ] : [] + ) }) ] } as Widget.BoxProps);