From 7227c1942c1df03011df383f629310b2671e3be5 Mon Sep 17 00:00:00 2001 From: retrozinndev Date: Wed, 30 Jul 2025 17:49:48 -0300 Subject: [PATCH] :boom: fix(bar/focused-client): str may not be null --- ags/widget/bar/FocusedClient.tsx | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/ags/widget/bar/FocusedClient.tsx b/ags/widget/bar/FocusedClient.tsx index 85a0956..e415674 100644 --- a/ags/widget/bar/FocusedClient.tsx +++ b/ags/widget/bar/FocusedClient.tsx @@ -1,9 +1,11 @@ import { Gtk } from "ags/gtk4"; -import AstalHyprland from "gi://AstalHyprland"; import { createBinding, With } from "ags"; import { variableToBoolean } from "../../scripts/utils"; import { getAppIcon, getSymbolicIcon } from "../../scripts/apps"; + import Pango from "gi://Pango?version=1.0"; +import AstalHyprland from "gi://AstalHyprland"; + const hyprland = AstalHyprland.get_default(); @@ -16,13 +18,13 @@ export const FocusedClient = () => { return - {(focusedClient) => focusedClient && - - getSymbolicIcon(clss) ?? getAppIcon(clss) ?? + {(focusedClient) => focusedClient?.class && + + getSymbolicIcon(clss) ?? getAppIcon(clss) ?? getAppIcon(focusedClient.initialClass) ?? - "application-x-executable-symbolic") - } vexpand={true} /> + "application-x-executable-symbolic" + )} vexpand + /> @@ -30,11 +32,14 @@ export const FocusedClient = () => { + tooltipText={createBinding(focusedClient, "class")} + /> + + tooltipText={createBinding(focusedClient, "title")} + /> }