💥 fix: incorrect usage of uwsm check is-active command on scripts

This commit is contained in:
retrozinndev
2025-06-16 17:20:24 -03:00
parent 818a04ffae
commit 41624d96d2
4 changed files with 18 additions and 10 deletions
+4 -2
View File
@@ -5,9 +5,11 @@ import AstalHyprland from "gi://AstalHyprland";
import { execAsync } from "astal";
export const uwsmIsActive: boolean = await execAsync(
"uwsm check is-active hyprland-uwsm.desktop"
).then(() => true).catch(() => false);
const astalApps: AstalApps.Apps = new AstalApps.Apps();
const uwsmIsActive: boolean = await execAsync("uwsm check is-active").then((stdout) =>
/hyprland/gi.test(stdout)).catch(() => false);
let appsList: Array<AstalApps.Application> = astalApps.get_list();
export function getApps(): Array<AstalApps.Application> {
+9 -3
View File
@@ -1,11 +1,17 @@
import { monitorFile, Process } from "astal";
import { execAsync, Gio, monitorFile } from "astal";
import { App } from "astal/gtk3";
import { uwsmIsActive } from "./apps";
const monitoringPaths = [ "./scripts", "./window", "./app.ts", "env.d.ts" ];
export function restartInstance(instanceName?: string): void {
Process.exec_async(`astal -q ${ instanceName || App.instanceName || "astal" }`, () => {});
Process.exec_async(`ags run`, () => {});
execAsync(`astal -q ${ instanceName ?? App.instanceName ?? "astal" }`);
Gio.Subprocess.new(
( uwsmIsActive ?
[ "uwsm", "app", "--", "ags", "run" ]
: [ "ags", "run" ]),
Gio.SubprocessFlags.STDOUT_PIPE | Gio.SubprocessFlags.STDERR_PIPE
);
}
export function monitorPaths(): void {