fix(agsV2): hide icon on current when needed
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-10-21 15:49:26 -04:00
parent 176ab348e9
commit 954495c5cc

View file

@ -11,6 +11,7 @@ import { hyprMessage } from '../../../lib';
export default () => {
const visibleIcon = Variable<boolean>(false);
const focusedIcon = Variable<string>('');
const focusedTitle = Variable<string>('');
@ -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 () => {
<icon
css="font-size: 32px;"
icon={bind(focusedIcon)}
visible={bind(visibleIcon)}
/>
<Separator size={8} />