nixos-configs/modules/ags/config/ts/misc/closer.ts
matt1432 a0014161ce
All checks were successful
Discord / discord commits (push) Has been skipped
refactor(ags): move wim and binto configs together under modules
2024-01-17 19:18:41 -05:00

14 lines
392 B
TypeScript

import App from 'resource:///com/github/Aylur/ags/app.js';
// Types
import AgsWindow from 'types/widgets/window';
export default () => {
(Array.from(App.windows) as Array<[string, AgsWindow]>)
.filter((w) => w[1].attribute?.close_on_unfocus &&
w[1].attribute?.close_on_unfocus !== 'stay')
.forEach((w) => {
App.closeWindow(w[0]);
});
};