From a1df7028f1abb02554667294a9815295182204f8 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sun, 24 Nov 2024 17:16:22 -0500 Subject: [PATCH] fix(ags): update current-client and fix network hover --- .../widgets/bar/items/current-client.tsx | 22 +++++++------ .../config/widgets/bar/items/current-icon.tsx | 26 +++++++-------- .../ags/config/widgets/bar/items/network.tsx | 33 +++++++------------ 3 files changed, 35 insertions(+), 46 deletions(-) diff --git a/nixosModules/ags/config/widgets/bar/items/current-client.tsx b/nixosModules/ags/config/widgets/bar/items/current-client.tsx index 0996e51b..e72a0494 100644 --- a/nixosModules/ags/config/widgets/bar/items/current-client.tsx +++ b/nixosModules/ags/config/widgets/bar/items/current-client.tsx @@ -16,16 +16,17 @@ export default () => { const focusedIcon = Variable(''); const focusedTitle = Variable(''); - let lastFocusedAddress: string | null; + // FIXME: readd this once client titles are fixed + // let lastFocusedAddress: string | null; const updateVars = ( client: AstalHyprland.Client | null = hyprland.get_focused_client(), ) => { - lastFocusedAddress = client ? client.get_address() : null; + // lastFocusedAddress = client ? client.address : null; const app = applications.fuzzy_query( - client?.get_class() ?? '', + client?.class ?? '', )[0]; const icon = app?.iconName; @@ -38,21 +39,21 @@ export default () => { visibleIcon.set(false); } - focusedTitle.set(client?.get_title() ?? ''); - const id = client?.connect('notify::title', (c) => { + focusedTitle.set(client?.title ?? ''); + /* const id = client?.connect('notify::title', (c) => { if (c.get_address() !== lastFocusedAddress) { c.disconnect(id); } + console.log(c.get_title()); focusedTitle.set(c.get_title()); - }); + });*/ }; updateVars(); - hyprland.connect('notify::focused-client', () => updateVars()); - hyprland.connect('client-removed', () => updateVars()); - hyprland.connect('client-added', async() => { + // hyprland.connect('notify::focused-client', () => updateVars()); + hyprland.connect('event', async() => { try { - updateVars(hyprland.get_client(JSON.parse(await hyprMessage('j/activewindow')).address)); + updateVars(JSON.parse(await hyprMessage('j/activewindow'))); } catch (e) { console.log(e); @@ -85,6 +86,7 @@ export default () => {