From 31272327ae739ee29dd9b809b26b9eb63cf2695e Mon Sep 17 00:00:00 2001 From: jbergner Date: Mon, 31 Aug 2026 16:17:26 +0200 Subject: [PATCH] v0.6.3 --- INSTALLATION.md | 20 +- Panel.qml | 16 +- README.md | 16 +- backend/bin/omarchy-citizen-backend | Bin 2166936 -> 2166936 bytes backend/cmd/omarchy-citizen-backend/main.go | 2 +- citizenctl | 224 +++++++++++++++++++- install.sh | 2 +- manifest.json | 4 +- 8 files changed, 265 insertions(+), 19 deletions(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index aff0959..ba5221d 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -1,4 +1,4 @@ -# Omarchy Citizen 0.6.2 – Plug-&-Play-Installation +# Omarchy Citizen 0.6.3 – Plug-&-Play-Installation ## Ziel @@ -275,9 +275,9 @@ Damit brauchst du im ersten Supportkontakt normalerweise keine Terminalbefehle vom Nutzer anzufordern. -## Hotfix 0.6.2 – Setup-Button +## Hotfix 0.6.3 – Setup-Button -Version 0.6.2 ändert die Ausführung der Panel-Aktionen grundlegend. +Version 0.6.3 ä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**. @@ -289,3 +289,17 @@ im Support-Paket. Nach der Installation wird der Omarchy-Shellprozess einmal neu gestartet, damit die neue QML-Version sicher aktiv ist. + +## 0.6.3 – unvollständiger Wine-Prefix + +Ein Ordner wie `~/Games/star-citizen` gilt jetzt erst dann als fertiger Wine-Prefix, +wenn mindestens `drive_c`, `system.reg` und `user.reg` existieren. + +Wenn nur Runner/Teildateien vorhanden sind, zeigt das Plugin **SETUP REPAIR**. + +Bei **SETUP SICHER REPARIEREN** wird der alte Ordner nicht gelöscht. Ohne erkannte +`Data.p4k`-Spieldatei wird er nach `star-citizen-incomplete-` umbenannt, +die LUG-Zielkonfiguration wird gesichert und der offizielle LUG-Installer startet neu. + +Das Support-Paket enthält jetzt außerdem den neuesten detaillierten +`lughelper-install-*.log`, damit Wine-/Winetricks-Fehler analysiert werden können. diff --git a/Panel.qml b/Panel.qml index 4512784..12ab468 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.2" + property string pluginVersion: "0.6.3" property string health: "checking" property string depsState: "checking" property string depsMissing: "" @@ -22,6 +22,7 @@ Panel { property string updateState: "unknown" property string updateVersion: "" property string prefixState: "checking" + property string prefixDetail: "" property string launcherState: "checking" property string gameState: "checking" property bool checkingUpdate: false @@ -96,7 +97,7 @@ Panel { values[lines[i].slice(0, p)] = lines[i].slice(p + 1) } - pluginVersion = values.plugin_version || "0.6.2" + pluginVersion = values.plugin_version || "0.6.3" health = values.health || "setup" depsState = values.deps || "missing" depsMissing = values.deps_missing || "" @@ -106,6 +107,7 @@ Panel { updateState = values.update || "unknown" updateVersion = values.update_version || "" prefixState = values.prefix || "missing" + prefixDetail = values.prefix_detail || "" launcherState = values.launcher || "missing" gameState = values.game || "missing" backendState = values.backend || "missing" @@ -134,13 +136,14 @@ Panel { function healthColor() { if (health === "ready") return success - if (health === "repair") return warning + if (health === "recover-prefix" || health === "repair") return warning if (health === "checking") return accent return accent } function headline() { if (health === "ready") return "FLIGHT READY" + if (health === "recover-prefix") return "SETUP REPAIR" if (health === "repair") return "REPAIR AVAILABLE" if (health === "checking") return "SYSTEM CHECK" return "READY FOR SETUP" @@ -149,6 +152,8 @@ Panel { function subline() { if (health === "ready") return "Alles Wesentliche wurde gefunden. Star Citizen ist einen Klick entfernt." + if (health === "recover-prefix") + return "Eine frühere Wine-Einrichtung ist nur teilweise vorhanden. Omarchy Citizen kann sie sichern und sauber neu aufsetzen." if (health === "repair") return "Omarchy Citizen hat eine reparierbare Lücke erkannt." if (health === "install-game") @@ -160,6 +165,7 @@ Panel { function primaryText() { if (health === "ready") return "▶ STAR CITIZEN STARTEN" + if (health === "recover-prefix") return "↻ SETUP SICHER REPARIEREN" if (health === "repair") return "↻ ERKANNTES PROBLEM BEHEBEN" return "▶ EINRICHTEN & STARTKLAR MACHEN" } @@ -557,7 +563,9 @@ Panel { StatusLine { label: "Wine-Prefix" state: root.prefixState - value: root.prefixState === "ready" ? "gefunden" : "nicht eingerichtet" + value: root.prefixState === "ready" + ? "initialisiert" + : (root.prefixState === "partial" ? "unvollständig · Reparatur möglich" : "nicht eingerichtet") } StatusLine { diff --git a/README.md b/README.md index fbfbb69..afd8b5e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Omarchy Citizen 0.6.2 +# Omarchy Citizen 0.6.3 A plug-and-play Star Citizen control panel for Omarchy. @@ -70,7 +70,7 @@ 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.2 hotfix +## 0.6.3 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 @@ -78,10 +78,20 @@ See [`backend/README.md`](backend/README.md) and [`GIT_DISTRIBUTION.md`](GIT_DIS - 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 -## 0.6.2 UI / setup hotfix +## 0.6.3 UI / setup hotfix - fixed `undefined` in reusable status rows and chips - panel no longer inherits the bar's theme font; uses a neutral system sans font - first-time setup keeps the panel open and shows a visible status message - setup terminal is launched directly through `xdg-terminal-exec`/UWSM with separate argv - failed package/AUR setup remains visible instead of the terminal disappearing immediately + +## 0.6.3 incomplete-prefix recovery + +- a configured folder is no longer considered a valid Wine prefix merely because it exists +- valid prefixes require `drive_c`, `system.reg`, and `user.reg` +- half-created prefixes are shown as `unvollständig` +- one-click recovery renames the incomplete directory to a timestamped backup instead of deleting it +- stale LUG target config files are backed up before a clean reinstall +- existing `Data.p4k` is never moved by Omarchy Citizen; migration is delegated to the LUG Helper +- support bundles now include the newest `/tmp/lughelper-install-*.log` and a prefix-health report diff --git a/backend/bin/omarchy-citizen-backend b/backend/bin/omarchy-citizen-backend index b13b795649ad7c9753c06bb8e6944bf9f25aca1d..a15d2ba0413fcb86b7c7ca9b42a5fb6d1a85c5de 100644 GIT binary patch delta 236 zcmWm5xemc_00-dIeV4j#FHnsXWo#G>702Jbh_2|NP5J;NeFdwriNWT1Jb_23pWz$7 z`{PF4;q|1+UTLel`Bqz2Yv`Z5JC`!2t*+UaY(@bCL#59 jX~wBhyzMj@NJ9p)kb^uFpa>->Lj|f(gZkTPHol)9tZG;O delta 236 zcmWm5xembq00!XHeV4j#FF;#F%MutY0nPBVvn73vc$40t|ZdaE!SM|e5+PHjq^&aaj2g~`Yh!ZyA~tJ2+EpM za-~U^UXJAQQYuuGXh)@PQu!5QGqfAp%i|K^zj0e5;w%_wxfzfmrGQ diff --git a/backend/cmd/omarchy-citizen-backend/main.go b/backend/cmd/omarchy-citizen-backend/main.go index 320099c..c574449 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.2" + appVersion = "0.6.3" pluginID = "local.omarchy-citizen" ) diff --git a/citizenctl b/citizenctl index 3175b67..a099cdf 100644 --- a/citizenctl +++ b/citizenctl @@ -2,7 +2,7 @@ set -u PLUGIN_ID="local.omarchy-citizen" -PLUGIN_VERSION="0.6.2" +PLUGIN_VERSION="0.6.3" CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/starcitizen-lug" DATA_DIR="${XDG_DATA_HOME:-$HOME/.local/share}" @@ -215,14 +215,51 @@ Wähle im SC-Panel „Einrichten“ – Omarchy Citizen installiert die benötig fi } -read_prefix() { +configured_prefix() { [[ -f "$WINE_CONF" ]] || return 1 local prefix IFS= read -r prefix < "$WINE_CONF" - [[ -n "$prefix" && -d "$prefix" ]] || return 1 + [[ -n "$prefix" ]] || return 1 printf '%s\n' "$prefix" } +prefix_is_initialized() { + local prefix="$1" + [[ -d "$prefix/drive_c" ]] && + [[ -f "$prefix/system.reg" ]] && + [[ -f "$prefix/user.reg" ]] +} + +read_prefix() { + local prefix + prefix="$(configured_prefix 2>/dev/null)" || return 1 + [[ -d "$prefix" ]] || return 1 + prefix_is_initialized "$prefix" || return 1 + printf '%s\n' "$prefix" +} + +find_incomplete_prefix() { + local prefix="" + + prefix="$(configured_prefix 2>/dev/null || true)" + if [[ -n "$prefix" && -d "$prefix" ]] && ! prefix_is_initialized "$prefix"; then + printf '%s\n' "$prefix" + return 0 + fi + + prefix="$HOME/Games/star-citizen" + if [[ -d "$prefix" ]] && ! prefix_is_initialized "$prefix"; then + # Only treat the default path as our incomplete prefix when it contains + # LUG/installation artifacts rather than an arbitrary empty user folder. + if [[ -d "$prefix/runners" || -f "$prefix/sc-launch.sh" || -f "$prefix/.lughelper" ]]; then + printf '%s\n' "$prefix" + return 0 + fi + fi + + return 1 +} + read_game_dir() { [[ -f "$GAME_CONF" ]] || return 1 local game_dir @@ -298,7 +335,7 @@ check_update() { status() { local helper="" version="" prefix="" game_dir="" dep missing_deps="" local helper_state="missing" helper_managed="missing" deps_state="ready" - local prefix_state="missing" launcher_state="missing" game_state="missing" + local prefix_state="missing" prefix_detail="" launcher_state="missing" game_state="missing" local update_state="unknown" update_version="" health="setup" for dep in "${GUI_PACKAGES[@]}"; do @@ -330,9 +367,13 @@ status() { if prefix="$(read_prefix 2>/dev/null)"; then prefix_state="ready" + prefix_detail="initialisiert" if [[ -f "$prefix/sc-launch.sh" ]]; then launcher_state="ready" fi + elif prefix="$(find_incomplete_prefix 2>/dev/null)"; then + prefix_state="partial" + prefix_detail="unvollständig" fi if game_dir="$(read_game_dir 2>/dev/null)"; then @@ -345,6 +386,8 @@ status() { if [[ "$deps_state" != "ready" || "$helper_state" != "ready" ]]; then health="setup" + elif [[ "$prefix_state" == "partial" ]]; then + health="recover-prefix" elif [[ "$prefix_state" != "ready" ]]; then health="install" elif [[ "$launcher_state" != "ready" ]]; then @@ -365,6 +408,7 @@ status() { printf 'update=%s\n' "$update_state" printf 'update_version=%s\n' "$update_version" printf 'prefix=%s\n' "$prefix_state" + printf 'prefix_detail=%s\n' "$prefix_detail" printf 'launcher=%s\n' "$launcher_state" printf 'game=%s\n' "$game_state" @@ -448,6 +492,131 @@ Bitte klicke auf „Support-Paket erstellen“. Der fehlgeschlagene Startversuch return 1 } + +backup_lug_target_configs() { + local stamp="$1" + local f + mkdir -p "$CONFIG_DIR" + for f in "$WINE_CONF" "$GAME_CONF"; do + if [[ -f "$f" ]]; then + mv -- "$f" "${f}.incomplete-${stamp}" + log_line "backed up LUG config $(basename "$f") -> $(basename "${f}.incomplete-${stamp}")" + fi + done +} + +stop_prefix_wineserver() { + local prefix="$1" + local wineserver="" + + # Kill only a wineserver associated with the runner inside this target prefix. + # Do not kill unrelated Wine applications globally. + wineserver="$(find "$prefix/runners" -type f -path '*/bin/wineserver' -perm -u+x -print -quit 2>/dev/null || true)" + if [[ -n "$wineserver" ]]; then + WINEPREFIX="$prefix" "$wineserver" -k >>"$LOG_FILE" 2>&1 || true + sleep 0.5 + fi +} + +recover_incomplete_prefix_interactive() { + local prefix stamp backup datap4k="" + + prefix="$(find_incomplete_prefix 2>/dev/null)" || { + log_line "recover-prefix requested but no incomplete prefix found" + guided_setup_interactive + return + } + + datap4k="$prefix/drive_c/Program Files/Roberts Space Industries/StarCitizen/LIVE/Data.p4k" + + # If real game data is present, never move it ourselves. Let the LUG Helper's + # built-in reinstall/migration path handle it. + if [[ -f "$datap4k" ]]; then + log_line "incomplete prefix contains Data.p4k; delegating migration to LUG Helper" + run_helper_sync --install || true + return + fi + + stamp="$(date '+%Y%m%d-%H%M%S')" + backup="${prefix}-incomplete-${stamp}" + + if command -v zenity >/dev/null 2>&1; then + if ! zenity --question \ + --width=600 \ + --title="Omarchy Citizen – unvollständiges Setup reparieren" \ + --ok-label="Automatisch reparieren" \ + --cancel-label="Abbrechen" \ + --text="Omarchy Citizen hat einen halbfertigen Star-Citizen-Wine-Prefix erkannt: + +$prefix + +Es fehlen drive_c und/oder die Wine-Registrydateien. Fertige Star-Citizen-Spieldaten (Data.p4k) wurden nicht gefunden. + +Der Ordner wird NICHT gelöscht, sondern sicher umbenannt nach: + +$backup + +Danach startet der offizielle LUG-Installer sauber neu." 2>/dev/null; then + return 0 + fi + else + printf '\nUnvollständiges Star-Citizen-Setup gefunden:\n%s\n\n' "$prefix" + printf 'Es wird gesichert als:\n%s\n\n' "$backup" + read -r -p "Automatisch reparieren? [j/N]: " answer + case "${answer,,}" in + j|ja|y|yes) ;; + *) return 0 ;; + esac + fi + + log_line "recovering incomplete prefix=$prefix backup=$backup" + stop_prefix_wineserver "$prefix" + + if ! mv -- "$prefix" "$backup"; then + notify_error "Der unvollständige Star-Citizen-Ordner konnte nicht gesichert werden. + +Bitte erstelle ein Support-Paket." + return 1 + fi + + backup_lug_target_configs "$stamp" + + notify "Omarchy Citizen" "Unvollständiges Setup wurde gesichert. Der LUG-Installer startet jetzt neu." + run_helper_sync --install || { + log_line "fresh LUG install after incomplete-prefix recovery failed" + if command -v zenity >/dev/null 2>&1; then + if zenity --question \ + --width=560 \ + --title="Star-Citizen-Setup fehlgeschlagen" \ + --ok-label="Support-Paket erstellen" \ + --cancel-label="Später" \ + --text="Auch der saubere Neuversuch konnte den Wine-Prefix nicht vollständig erstellen. + +Deine vorherige Installation wurde nicht gelöscht; sie liegt als Backup vor. + +Soll Omarchy Citizen jetzt direkt ein Support-Paket erstellen?" 2>/dev/null; then + "$SELF" support-build + fi + fi + return 1 + } + + if read_prefix >/dev/null 2>&1; then + notify "Omarchy Citizen" "Wine-Prefix wurde erfolgreich erstellt." + log_line "incomplete-prefix recovery succeeded" + else + log_line "LUG install returned but prefix still incomplete" + notify_error "Der LUG-Installer wurde beendet, aber der Wine-Prefix ist weiterhin unvollständig. + +Bitte erstelle ein Support-Paket." + return 1 + fi +} + +recover_incomplete_prefix() { + nohup bash "$SELF" recover-prefix-interactive >>"$LOG_FILE" 2>&1 & +} + guided_setup_interactive() { log_line "guided-setup begin" @@ -456,6 +625,12 @@ guided_setup_interactive() { return 0 fi + if find_incomplete_prefix >/dev/null 2>&1; then + log_line "guided setup found incomplete prefix; switching to recovery" + recover_incomplete_prefix_interactive + return $? + fi + run_helper_sync --preflight-check || true if ! read_prefix >/dev/null 2>&1; then @@ -544,7 +719,13 @@ install_stack_terminal() { run_helper_sync --preflight-check || true - if ! read_prefix >/dev/null 2>&1; then + if find_incomplete_prefix >/dev/null 2>&1; then + echo + echo "Eine frühere, unvollständige Wine-Prefix-Erstellung wurde erkannt." + echo "Die Reparatur wird jetzt grafisch fortgesetzt." + echo + recover_incomplete_prefix_interactive + elif ! read_prefix >/dev/null 2>&1; then run_helper_sync --install || true fi @@ -612,6 +793,9 @@ primary_action() { setup) launch_terminal_action install-stack-terminal ;; + recover-prefix) + recover_incomplete_prefix + ;; install) guided_setup ;; @@ -639,6 +823,10 @@ repair_assistant_interactive() { launch_terminal_action install-stack-terminal return ;; + recover-prefix) + recover_incomplete_prefix_interactive + return + ;; install) guided_setup_interactive return @@ -859,6 +1047,30 @@ EOF rm -f "$CACHE_DIR/update-log-$$.txt" fi + # LUG Helper writes the detailed Wine-prefix installation output here. + # This is the most useful file when winetricks/Wine prefix creation fails. + latest_lug_install_log="$(find /tmp -maxdepth 1 -type f -name 'lughelper-install-*.log' -printf '%T@ %p\n' 2>/dev/null \ + | sort -nr | head -n1 | cut -d' ' -f2- || true)" + if [[ -n "$latest_lug_install_log" && -f "$latest_lug_install_log" ]]; then + tail -n 1200 "$latest_lug_install_log" > "$CACHE_DIR/lug-install-$$.txt" + sanitize_to "$CACHE_DIR/lug-install-$$.txt" "$work/lug-helper-install-tail.log" + rm -f "$CACHE_DIR/lug-install-$$.txt" + fi + + configured="$(configured_prefix 2>/dev/null || true)" + if [[ -n "$configured" ]]; then + { + printf 'configured_prefix=%s\n' "$configured" + printf 'directory_exists=%s\n' "$([[ -d "$configured" ]] && echo yes || echo no)" + printf 'drive_c=%s\n' "$([[ -d "$configured/drive_c" ]] && echo present || echo missing)" + printf 'system_reg=%s\n' "$([[ -f "$configured/system.reg" ]] && echo present || echo missing)" + printf 'user_reg=%s\n' "$([[ -f "$configured/user.reg" ]] && echo present || echo missing)" + printf 'runner_dirs=%s\n' "$(find "$configured/runners" -mindepth 1 -maxdepth 1 -type d -printf '%f ' 2>/dev/null || true)" + } > "$CACHE_DIR/prefix-health-$$.txt" + sanitize_to "$CACHE_DIR/prefix-health-$$.txt" "$work/wine-prefix-health.txt" + rm -f "$CACHE_DIR/prefix-health-$$.txt" + fi + prefix="$(read_prefix 2>/dev/null || true)" game_dir="$(read_game_dir 2>/dev/null || true)" @@ -1055,6 +1267,8 @@ case "$ACTION" in status) status ;; primary) primary_action ;; setup) guided_setup ;; + recover-prefix) recover_incomplete_prefix ;; + recover-prefix-interactive) recover_incomplete_prefix_interactive ;; guided-setup-interactive) guided_setup_interactive ;; repair) repair_assistant ;; repair-interactive) repair_assistant_interactive ;; diff --git a/install.sh b/install.sh index 9ba9f82..dc776e2 100644 --- a/install.sh +++ b/install.sh @@ -44,7 +44,7 @@ omarchy plugin enable "$PLUGIN_ID" omarchy restart shell >/dev/null 2>&1 || true echo -echo "Omarchy Citizen 0.6.2 wurde installiert:" +echo "Omarchy Citizen 0.6.3 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 7db5b4c..1a62484 100644 --- a/manifest.json +++ b/manifest.json @@ -2,10 +2,10 @@ "schemaVersion": 1, "id": "local.omarchy-citizen", "name": "Omarchy Citizen", - "version": "0.6.2", + "version": "0.6.3", "author": "Community prototype", "license": "MIT", - "description": "Plug-and-play Star Citizen controls for Omarchy. 0.6.2 fixes status rendering and makes first-time setup visibly reliable.", + "description": "Plug-and-play Star Citizen controls for Omarchy. 0.6.3 detects and safely recovers incomplete Wine prefixes and improves LUG install diagnostics.", "kinds": [ "bar-widget" ],