From 818a04ffae3a37832ce483123fbe95838536d6fd Mon Sep 17 00:00:00 2001 From: retrozinndev Date: Mon, 16 Jun 2025 16:49:58 -0300 Subject: [PATCH 1/2] :boom: fix(hypr/scripts/exec.sh): some commands not running when using hyprctl stopped using Hyprland's exec dispatcher, no need for it --- hypr/scripts/exec.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hypr/scripts/exec.sh b/hypr/scripts/exec.sh index d0ddf68..08c3485 100644 --- a/hypr/scripts/exec.sh +++ b/hypr/scripts/exec.sh @@ -9,8 +9,8 @@ if uwsm check is-active; then - hyprctl dispatch exec "uwsm app -- $@" > /dev/null + exec uwsm-app -- $@ exit 0 fi -hyprctl dispatch exec "$@" > /dev/null +exec $@ From 41624d96d261ec5e3a2fd73bdeb6266c94a9375b Mon Sep 17 00:00:00 2001 From: retrozinndev Date: Mon, 16 Jun 2025 17:20:24 -0300 Subject: [PATCH 2/2] :boom: fix: incorrect usage of `uwsm check is-active` command on scripts --- ags/scripts/apps.ts | 6 ++++-- ags/scripts/reload-handler.ts | 12 +++++++++--- hypr/scripts/exec.sh | 6 +++--- hypr/shell/autostart.conf | 4 ++-- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ags/scripts/apps.ts b/ags/scripts/apps.ts index 5741c3a..ccb6c59 100644 --- a/ags/scripts/apps.ts +++ b/ags/scripts/apps.ts @@ -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.get_list(); export function getApps(): Array { diff --git a/ags/scripts/reload-handler.ts b/ags/scripts/reload-handler.ts index d04f82a..e4a2de0 100644 --- a/ags/scripts/reload-handler.ts +++ b/ags/scripts/reload-handler.ts @@ -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 { diff --git a/hypr/scripts/exec.sh b/hypr/scripts/exec.sh index 08c3485..c5f787d 100644 --- a/hypr/scripts/exec.sh +++ b/hypr/scripts/exec.sh @@ -8,9 +8,9 @@ # From: https://github.com/retrozinndev/colorshell -if uwsm check is-active; then - exec uwsm-app -- $@ +if uwsm check is-active "hyprland-uwsm.desktop"; then + exec uwsm app -- "$@" exit 0 fi -exec $@ +exec "$@" diff --git a/hypr/shell/autostart.conf b/hypr/shell/autostart.conf index 458e956..1845d16 100644 --- a/hypr/shell/autostart.conf +++ b/hypr/shell/autostart.conf @@ -14,8 +14,8 @@ exec-once = systemctl enable --user --now hyprsunset exec-once = systemctl enable --user --now hyprpaper # Scripts -exec-once = $exec sh $XDG_CONFIG_HOME/hypr/scripts/gen-pywal.sh -exec-once = $exec sleep 3 && sh $XDG_CONFIG_HOME/hypr/scripts/load-hyprsunset.sh # wait some time to actually set the filters +exec-once = sh $XDG_CONFIG_HOME/hypr/scripts/gen-pywal.sh +exec-once = sleep 3 && sh $XDG_CONFIG_HOME/hypr/scripts/load-hyprsunset.sh # wait some time to actually set the filters # Shell exec-once = $exec ags run