nixos-configs/modules/ags/config/ts/misc/closer.ts

15 lines
392 B
TypeScript
Raw Normal View History

import App from 'resource:///com/github/Aylur/ags/app.js';
2024-01-13 11:15:08 -05:00
// Types
import AgsWindow from 'types/widgets/window';
export default () => {
2024-01-13 11:15:08 -05:00
(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]);
});
};