From b2db8ceb0dd6b3998cb4ef4137a47e1a4c68aefa Mon Sep 17 00:00:00 2001 From: retrozinndev Date: Thu, 10 Apr 2025 16:22:00 -0300 Subject: [PATCH] :sparkles: ags: add default windows to open on startup --- ags/app.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ags/app.ts b/ags/app.ts index abe9d57..82558f7 100644 --- a/ags/app.ts +++ b/ags/app.ts @@ -18,6 +18,10 @@ import AstalNotifd from "gi://AstalNotifd"; import { GObject } from "astal"; +const defaultWindows: Array = [ + "bar" +]; + let osdTimer: (Time|undefined); let connections = new Map | number)>(); @@ -36,7 +40,7 @@ App.start({ }, main() { console.log(`[LOG] Initialized astal instance as: ${ App.instanceName || "astal" }`); - App.vfunc_quit = () => { + App.vfunc_dispose = () => { console.log("[LOG] Disconnecting stuff"); connections.forEach((v, k) => Array.isArray(v) ? v.map(id => k.disconnect(id)) @@ -66,6 +70,13 @@ App.start({ console.log(`[LOG] Adding runner plugins`); runnerPlugins.map(plugin => Runner.addPlugin(plugin)); + + console.log("[LOG] Opening default windows"); + // Open openOnStart windows + defaultWindows.map(name => { + if(Windows.isVisible(name)) return; + Windows.open(name); + }); } });