From 1ad2446e0a97a6ff162fcf91663f920b71bc6c5f Mon Sep 17 00:00:00 2001
From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Date: Fri, 11 Apr 2025 21:27:51 +1000
Subject: app: increase delay for initing services

So startup is not interrupted on slower setups
---
 app.tsx | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'app.tsx')

diff --git a/app.tsx b/app.tsx
index fd2ded1..3ea6413 100644
--- a/app.tsx
+++ b/app.tsx
@@ -16,7 +16,6 @@ import { execAsync, idle, timeout, writeFileAsync } from "astal";
 import { App } from "astal/gtk3";
 import { style } from "config";
 import { initConfig, updateConfig } from "config/funcs";
-import AstalHyprland from "gi://AstalHyprland?version=0.1";
 
 const isLayer = (name: string) =>
     ["base", "mantle", "crust"].includes(name) || name.startsWith("surface") || name.startsWith("overlay");
@@ -86,7 +85,7 @@ App.start({
             Monitors.get_default().forEach(m => <BarScreenCorners monitor={m} />);
 
             // Init services
-            timeout(1000, () => {
+            timeout(5000, () => {
                 idle(() => Schemes.get_default());
                 idle(() => Wallpapers.get_default());
                 idle(() => Calendar.get_default());
@@ -102,7 +101,7 @@ App.start({
         else if (request === "reload-config") updateConfig();
         else if (request.startsWith("show")) App.get_window(request.split(" ")[1])?.show();
         else if (request.startsWith("toggle"))
-            App.toggle_window(request.split(" ")[1] + AstalHyprland.get_default().focusedMonitor.id);
+            App.toggle_window(request.split(" ")[1] + Monitors.get_default().active.id);
         else if (request === "media play-pause") Players.get_default().lastPlayer?.play_pause();
         else if (request === "media next") Players.get_default().lastPlayer?.next();
         else if (request === "media previous") Players.get_default().lastPlayer?.previous();
-- 
cgit v1.2.3-freya

