Files
custum-hyprpanel/globals/utilities.ts
Jas Singh a4f5fb5917 Refactor Polling Mechanism: Implement Class-Based Poller with Start/Stop Control (#528)
* custom module updates to class based.

* Finish poller logic.

* Use composition for pollers

* Rename poller

* Handle recorder polling.

* Fix quotes in bash command

* Remove logs
2024-11-23 03:55:00 -08:00

23 lines
558 B
TypeScript

import options from 'options';
globalThis.isWindowVisible = (windowName: string): boolean => {
const appWindow = App.getWindow(windowName);
if (appWindow === undefined) {
return false;
}
return appWindow.visible;
};
globalThis.setLayout = (layout: string): string => {
try {
const layoutJson = JSON.parse(layout);
const { layouts } = options.bar;
layouts.value = layoutJson;
return 'Successfully updated layout.';
} catch (error) {
return `Failed to set layout: ${error}`;
}
};