diff --git a/INSTALLATION.md b/INSTALLATION.md index 8298023..393dee8 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -1,4 +1,4 @@ -# Omarchy Citizen 0.6.0 – Plug-&-Play-Installation +# Omarchy Citizen 0.6.1 – Plug-&-Play-Installation ## Ziel @@ -273,3 +273,19 @@ Wenn ein Nutzer ein Problem meldet, kannst du ihn bitten: Damit brauchst du im ersten Supportkontakt normalerweise keine Terminalbefehle vom Nutzer anzufordern. + + +## Hotfix 0.6.1 – Setup-Button + +Version 0.6.1 ändert die Ausführung der Panel-Aktionen grundlegend. + +Beim Klick auf **EINRICHTEN & STARTKLAR MACHEN** wird die Aktion nun direkt als +Quickshell-Prozess gestartet. Das Panel zeigt sofort **WIRD GESTARTET**. + +Wenn der Start fehlschlägt, bleibt das Panel offen und zeigt den Fehler an. +Außerdem wird der fehlgeschlagene Terminalstart in +`~/.local/state/omarchy-citizen/omarchy-citizen.log` protokolliert und landet +im Support-Paket. + +Nach der Installation wird der Omarchy-Shellprozess einmal neu gestartet, damit +die neue QML-Version sicher aktiv ist. diff --git a/INSTALLIEREN.sh b/INSTALLIEREN.sh index 84ef328..404d21e 100644 --- a/INSTALLIEREN.sh +++ b/INSTALLIEREN.sh @@ -51,6 +51,9 @@ omarchy-shell shell rescanPlugins >/dev/null 2>&1 || true omarchy plugin enable "$PLUGIN_ID" >/dev/null 2>&1 || true omarchy bar move "$PLUGIN_ID" --section right >/dev/null 2>&1 || true +# QML hot-reload is currently unreliable for third-party bar plugins. +omarchy restart shell >/dev/null 2>&1 || true + message "Omarchy Citizen" "Installation abgeschlossen. Oben in der Omarchy-Leiste findest du jetzt ✦SC. diff --git a/Panel.qml b/Panel.qml index 72d0a73..d9c1edf 100644 --- a/Panel.qml +++ b/Panel.qml @@ -12,7 +12,7 @@ Panel { property var anchorItem: null property var hostWidget: null - property string pluginVersion: "0.6.0" + property string pluginVersion: "0.6.1" property string health: "checking" property string depsState: "checking" property string depsMissing: "" @@ -33,6 +33,10 @@ Panel { property string pluginUpdate: "unavailable" property string pluginLocalCommit: "" property string pluginRemoteCommit: "" + property string actionStatus: "" + property string actionError: "" + property string actionKind: "" + property bool actionCloseOnSuccess: true readonly property color accent: "#56d2ff" readonly property color accentSoft: "#1c3444" @@ -60,11 +64,15 @@ Panel { } function runAction(action, closePanel) { - if (!root.bar) return - root.bar.run( - "bash " + root.bar.shellQuote(root.controlScript) + " " + root.bar.shellQuote(action) - ) - if (closePanel !== false) root.close() + if (actionProc.running) return + + root.actionKind = String(action || "") + root.actionCloseOnSuccess = closePanel !== false + root.actionError = "" + root.actionStatus = "Aktion wird gestartet…" + + actionProc.command = ["bash", root.controlScript, root.actionKind] + actionProc.running = true } function refreshStatus() { @@ -87,7 +95,7 @@ Panel { values[lines[i].slice(0, p)] = lines[i].slice(p + 1) } - pluginVersion = values.plugin_version || "0.5.0" + pluginVersion = values.plugin_version || "0.6.1" health = values.health || "setup" depsState = values.deps || "missing" depsMissing = values.deps_missing || "" @@ -188,6 +196,52 @@ Panel { } } + Process { + id: actionProc + running: false + command: [] + + stdout: StdioCollector { + id: actionOut + waitForEnd: true + } + + stderr: StdioCollector { + id: actionErr + waitForEnd: true + } + + onStarted: { + root.actionStatus = root.actionKind === "primary" + ? "Setup/Start wird vorbereitet…" + : "Aktion wird ausgeführt…" + } + + onExited: function(exitCode) { + if (exitCode === 0) { + root.actionError = "" + root.actionStatus = "Gestartet." + root.refreshStatus() + + if (root.actionCloseOnSuccess) + closeAfterAction.restart() + } else { + var detail = String(actionErr.text || "").trim() + root.actionStatus = "" + root.actionError = detail !== "" + ? detail + : "Die Aktion konnte nicht gestartet werden. Bitte erstelle ein Support-Paket." + } + } + } + + Timer { + id: closeAfterAction + interval: 350 + repeat: false + onTriggered: root.close() + } + Timer { interval: 10000 repeat: true @@ -286,13 +340,48 @@ Panel { Button { width: parent.width - text: root.primaryText() + text: actionProc.running + ? "… WIRD GESTARTET" + : root.primaryText() foreground: root.barForeground fontFamily: root.bar ? root.bar.fontFamily : Style.font.family bordered: true - active: root.health === "ready" + active: root.health === "ready" || actionProc.running onClicked: root.runAction(root.health === "repair" ? "repair" : "primary") } + + Text { + visible: root.actionStatus !== "" + width: parent.width + text: root.actionStatus + color: root.accent + font.family: root.bar ? root.bar.fontFamily : Style.font.family + font.pixelSize: Style.font.caption + wrapMode: Text.WordWrap + } + + Rectangle { + visible: root.actionError !== "" + width: parent.width + radius: 10 + color: Qt.rgba(root.danger.r, root.danger.g, root.danger.b, 0.10) + border.color: root.danger + border.width: 1 + implicitHeight: actionErrorText.implicitHeight + Style.space(16) + + Text { + id: actionErrorText + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + anchors.margins: Style.space(8) + text: root.actionError + color: root.danger + font.family: root.bar ? root.bar.fontFamily : Style.font.family + font.pixelSize: Style.font.caption + wrapMode: Text.WordWrap + } + } } } diff --git a/README.md b/README.md index 201a09c..a566be7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Omarchy Citizen 0.6.0 +# Omarchy Citizen 0.6.1 A plug-and-play Star Citizen control panel for Omarchy. @@ -68,3 +68,12 @@ hours. The Git `origin` present when auto-update is enabled is pinned as the tru remote; unattended updates stop if that remote changes or the checkout is dirty. See [`backend/README.md`](backend/README.md) and [`GIT_DISTRIBUTION.md`](GIT_DISTRIBUTION.md). + + +## 0.6.1 hotfix + +- primary/setup actions now run through a Quickshell `Process` instead of fire-and-forget `bar.run` +- the panel shows `WIRD GESTARTET` immediately after a click +- startup failures stay visible in the panel instead of silently closing it +- terminal launch has a monitored fallback path and logs immediate launcher failures +- installers restart the Omarchy shell after QML changes to avoid stale third-party plugin QML diff --git a/backend/bin/omarchy-citizen-backend b/backend/bin/omarchy-citizen-backend index f79e1c5..acbc6f5 100644 Binary files a/backend/bin/omarchy-citizen-backend and b/backend/bin/omarchy-citizen-backend differ diff --git a/backend/cmd/omarchy-citizen-backend/main.go b/backend/cmd/omarchy-citizen-backend/main.go index f8c9b8b..4fc5483 100644 --- a/backend/cmd/omarchy-citizen-backend/main.go +++ b/backend/cmd/omarchy-citizen-backend/main.go @@ -16,7 +16,7 @@ import ( ) const ( - appVersion = "0.6.0" + appVersion = "0.6.1" pluginID = "local.omarchy-citizen" ) @@ -318,6 +318,12 @@ func (a *App) update(automatic bool) error { a.logf("backend self-sync warning: %v", err) } _ = run("", "omarchy-shell", "shell", "rescanPlugins") + if !automatic { + // Current Omarchy releases can keep stale third-party bar QML after a rescan. + // A user-triggered update may safely request a full shell restart so the + // freshly validated plugin code becomes active immediately. + _ = run("", "omarchy", "restart", "shell") + } return nil } diff --git a/citizenctl b/citizenctl index f60217d..3a91080 100644 --- a/citizenctl +++ b/citizenctl @@ -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 } diff --git a/install.sh b/install.sh index 9b5d228..af5e27b 100644 --- a/install.sh +++ b/install.sh @@ -40,8 +40,11 @@ echo "Aktiviere Plugin..." omarchy plugin enable "$PLUGIN_ID" +# QML hot-reload is currently unreliable for third-party bar plugins. +omarchy restart shell >/dev/null 2>&1 || true + echo -echo "Omarchy Citizen 0.6.0 wurde installiert:" +echo "Omarchy Citizen 0.6.1 wurde installiert:" echo " $DEST" echo echo "Links-Klick auf 'SC' in der Omarchy-Leiste öffnet das Star-Citizen-Panel." diff --git a/manifest.json b/manifest.json index d5a54bf..54576d3 100644 --- a/manifest.json +++ b/manifest.json @@ -2,10 +2,10 @@ "schemaVersion": 1, "id": "local.omarchy-citizen", "name": "Omarchy Citizen", - "version": "0.6.0", + "version": "0.6.1", "author": "Community prototype", "license": "MIT", - "description": "Plug-and-play Star Citizen controls for Omarchy with guided repair, support bundles and a Go-based automatic plugin update backend.", + "description": "Plug-and-play Star Citizen controls for Omarchy with reliable in-panel action execution, guided setup/repair, debug support bundles, update backend and optional NGL.", "kinds": [ "bar-widget" ],