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

14 lines
342 B
TypeScript
Raw Normal View History

2024-01-13 11:15:08 -05:00
// Types
import { PopupWindow } from 'global-types';
2024-01-13 11:15:08 -05:00
export default () => {
(Array.from(App.windows) as Array<[string, PopupWindow]>)
.filter((w) =>
w[1].attribute.close_on_unfocus &&
w[1].attribute.close_on_unfocus !== 'stay')
.forEach((w) => {
App.closeWindow(w[0]);
});
};