From 8c32a7372bc0500c0ad81a35921e78a1c2cfb124 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 25 Nov 2024 13:25:14 -0500 Subject: [PATCH] chore(ags): update client title stuff --- flake.lock | Bin 55048 -> 55048 bytes nixosModules/ags/config/app.ts | 1 - .../widgets/bar/items/current-client.tsx | 23 +++++------------- .../config/widgets/bar/items/current-icon.tsx | 18 +------------- .../widgets/on-screen-keyboard/keys.tsx | 15 ------------ 5 files changed, 7 insertions(+), 50 deletions(-) diff --git a/flake.lock b/flake.lock index d001e45b2933975d45956bce032ec1a5f75756dd..f722e6e188b5ac24709b04c5bc1388e207c60deb 100644 GIT binary patch delta 122 zcmeBJ$K0`wc|#aGi>0B3$z(+-Ijuko$IP5E!=S*7jGQ2sM3V}~!m^Ak@5Efo;z&O) z^WY)_ckS?U#~^R_$&RMtlVdrwCjMpDNHR}MGc!yvH#aafG)OW`Hn%iS1(Jrw=7}aL ZiI&DD$tlT+=7~m=8wI^L$8xMb2LLg7CXWCB delta 120 zcmeBJ$K0`wc|#aGi@BwR@nl6QIV~?kZHv?llgecGNK4mZ!?0{ipVDyiP{*u-aw9*3 zJfFlI-|+Gr&s=Y>$&C8qlVdrwCjRA6OExwzNli00F-uA{GBQX>F- { @@ -16,14 +15,13 @@ export default () => { const focusedIcon = Variable(''); const focusedTitle = Variable(''); - // FIXME: readd this once client titles are fixed - // let lastFocusedAddress: string | null; + let lastFocusedAddress: string | null; const updateVars = ( client: AstalHyprland.Client | null = hyprland.get_focused_client(), ) => { - // lastFocusedAddress = client ? client.address : null; + lastFocusedAddress = client ? client.address : null; const app = applications.fuzzy_query( client?.class ?? '', @@ -40,25 +38,16 @@ export default () => { } focusedTitle.set(client?.title ?? ''); - /* const id = client?.connect('notify::title', (c) => { + 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('event', async() => { - try { - updateVars(JSON.parse(await hyprMessage('j/activewindow'))); - } - catch (e) { - console.log(e); - } - }); + hyprland.connect('notify::focused-client', () => updateVars()); return ( {