This commit is contained in:
2026-08-31 15:29:56 +02:00
parent 88bb7c3229
commit 2be7267c41
9 changed files with 192 additions and 25 deletions
+51 -10
View File
@@ -2,7 +2,7 @@
set -u
PLUGIN_ID="local.omarchy-citizen"
PLUGIN_VERSION="0.6.0"
PLUGIN_VERSION="0.6.1"
CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/starcitizen-lug"
DATA_DIR="${XDG_DATA_HOME:-$HOME/.local/share}"
@@ -381,24 +381,65 @@ status() {
printf 'plugin_remote_commit=%s\n' "$(printf '%s\n' "$backend_output" | sed -n 's/^remote_commit=//p' | head -n1)"
}
probe_detached_start() {
local label="$1"
shift
"$@" >>"$LOG_FILE" 2>&1 &
local pid=$!
# Give immediate launcher errors a chance to surface. A successful terminal
# launcher may either stay alive or exit 0 after handing the terminal off.
sleep 0.35
if ! kill -0 "$pid" 2>/dev/null; then
local rc=0
wait "$pid" || rc=$?
if (( rc != 0 )); then
log_line "$label failed rc=$rc"
return "$rc"
fi
else
disown "$pid" 2>/dev/null || true
fi
log_line "$label accepted"
return 0
}
launch_terminal_action() {
local action="$1"
local cmd
log_line "launch-terminal action=$action"
printf -v cmd 'bash %q %q' "$SELF" "$action"
log_line "launch-terminal action=$action cmd=$cmd"
if command -v omarchy-launch-floating-terminal-with-presentation >/dev/null 2>&1; then
nohup omarchy-launch-floating-terminal-with-presentation bash "$SELF" "$action" \
>>"$LOG_FILE" 2>&1 &
return 0
if probe_detached_start "omarchy-floating-terminal" \
omarchy-launch-floating-terminal-with-presentation bash "$SELF" "$action"; then
return 0
fi
log_line "primary floating terminal launcher failed; trying direct terminal fallback"
fi
if command -v xdg-terminal-exec >/dev/null 2>&1; then
nohup xdg-terminal-exec -e bash "$SELF" "$action" \
>>"$LOG_FILE" 2>&1 &
return 0
if command -v uwsm-app >/dev/null 2>&1 && command -v xdg-terminal-exec >/dev/null 2>&1; then
if probe_detached_start "direct-omarchy-terminal" \
setsid uwsm-app -- xdg-terminal-exec \
--app-id=org.omarchy.terminal \
--title="Omarchy Citizen" \
-e bash -c "$cmd"; then
return 0
fi
elif command -v xdg-terminal-exec >/dev/null 2>&1; then
if probe_detached_start "xdg-terminal" \
xdg-terminal-exec -e bash "$SELF" "$action"; then
return 0
fi
fi
notify_error "Es konnte kein Omarchy-Terminal für die Paketinstallation gestartet werden."
notify_error "Das Setup-Terminal konnte nicht geöffnet werden.
Bitte erstelle im SC-Panel ein Support-Paket. Darin ist jetzt auch der fehlgeschlagene Startversuch protokolliert."
return 1
}