💥 fix(ags/bar): fix FocusedClient widget to update client title and class automatically
This commit is contained in:
@@ -24,20 +24,20 @@ export function FocusedClient() {
|
|||||||
orientation: Gtk.Orientation.VERTICAL,
|
orientation: Gtk.Orientation.VERTICAL,
|
||||||
homogeneous: false,
|
homogeneous: false,
|
||||||
valign: Gtk.Align.CENTER,
|
valign: Gtk.Align.CENTER,
|
||||||
children: [
|
children: bind(hyprland, "focusedClient").as((focusedClient: AstalHyprland.Client) =>
|
||||||
|
focusedClient ? [
|
||||||
new Widget.Label({
|
new Widget.Label({
|
||||||
className: "class",
|
className: "class",
|
||||||
xalign: 0,
|
xalign: 0,
|
||||||
label: bind(hyprland, "focusedClient").as((client: AstalHyprland.Client) =>
|
label: bind(focusedClient, "class")
|
||||||
client ? client.class : "")
|
|
||||||
} as Widget.LabelProps),
|
} as Widget.LabelProps),
|
||||||
new Widget.Label({
|
new Widget.Label({
|
||||||
className: "title",
|
className: "title",
|
||||||
xalign: 0,
|
xalign: 0,
|
||||||
label: bind(hyprland, "focusedClient").as((client: AstalHyprland.Client) =>
|
label: bind(focusedClient, "title")
|
||||||
client ? client.title : "")
|
|
||||||
} as Widget.LabelProps)
|
} as Widget.LabelProps)
|
||||||
]
|
] : []
|
||||||
|
)
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
} as Widget.BoxProps);
|
} as Widget.BoxProps);
|
||||||
|
|||||||
Reference in New Issue
Block a user