From 5455cc3af5ec62cf1282d5034b113077f6d3eb93 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 19 Jul 2025 15:52:31 +1000 Subject: launcher: better app launch More foolproof (hopefully) Also set working directory correctly --- assets/wrap_term_launch.sh | 5 +++++ services/Apps.qml | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100755 assets/wrap_term_launch.sh diff --git a/assets/wrap_term_launch.sh b/assets/wrap_term_launch.sh new file mode 100755 index 0000000..caf60c7 --- /dev/null +++ b/assets/wrap_term_launch.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +cat ~/.local/state/caelestia/sequences.txt 2>/dev/null + +exec "$@" diff --git a/services/Apps.qml b/services/Apps.qml index e2addcd..d561d15 100644 --- a/services/Apps.qml +++ b/services/Apps.qml @@ -12,10 +12,14 @@ Searcher { function launch(entry: DesktopEntry): void { if (entry.runInTerminal) - Quickshell.execDetached(["app2unit", "--", "foot", "fish", "-C", entry.execString]); - else if (entry.execString.startsWith("sh -c")) - Quickshell.execDetached(["sh", "-c", `app2unit -- ${entry.execString}`]); + Quickshell.execDetached({ + command: ["app2unit", "--", "foot", `${Quickshell.configDir}/assets/wrap_term_launch.sh`, ...entry.command], + workingDirectory: entry.workingDirectory + }); else - Quickshell.execDetached(["sh", "-c", `app2unit -- '${entry.id}.desktop' || app2unit -- ${entry.execString}`]); + Quickshell.execDetached({ + command: ["app2unit", "--", ...entry.command], + workingDirectory: entry.workingDirectory + }); } } -- cgit v1.2.3-freya