From 954495c5cce8d150ceae7858a0d04d406ba5e960 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 21 Oct 2024 15:49:26 -0400 Subject: [PATCH] fix(agsV2): hide icon on current when needed --- .../ags/v2/widgets/bar/items/current-client.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nixosModules/ags/v2/widgets/bar/items/current-client.tsx b/nixosModules/ags/v2/widgets/bar/items/current-client.tsx index 241a6665..cf985302 100644 --- a/nixosModules/ags/v2/widgets/bar/items/current-client.tsx +++ b/nixosModules/ags/v2/widgets/bar/items/current-client.tsx @@ -11,6 +11,7 @@ import { hyprMessage } from '../../../lib'; export default () => { + const visibleIcon = Variable(false); const focusedIcon = Variable(''); const focusedTitle = Variable(''); @@ -24,7 +25,16 @@ export default () => { client?.get_class() ?? '', )[0]; - focusedIcon.set(app?.iconName ?? ''); + const icon = app?.iconName; + + if (icon) { + visibleIcon.set(true); + focusedIcon.set(icon); + } + else { + visibleIcon.set(false); + } + focusedTitle.set(client?.get_title() ?? ''); const id = client?.connect('notify::title', (c) => { if (c.get_address() !== lastFocused) { @@ -54,6 +64,7 @@ export default () => {