From 6cb48f372b6c6bfe7a47c710ee206c96b46ef944 Mon Sep 17 00:00:00 2001 From: jon Date: Mon, 18 May 2026 13:43:14 -0500 Subject: [PATCH] Wire theme restore/backup into bin/restore.sh and bin/backup.sh - restore.sh: after folder+venv+frontend restore, runs assets/themes/install-theme.sh to rebuild the desktop wiring - backup.sh: snapshots live xfconf + GTK 3/4 settings.ini into assets/themes/restore-snapshot/ before the router mirror, so the backup captures actual state (install-theme.sh stays the applier) Co-Authored-By: Claude Opus 4.7 --- .../restore-snapshot/gtk-3.0-settings.ini | 15 +++++++++++++++ .../restore-snapshot/gtk-4.0-settings.ini | 12 ++++++++++++ assets/themes/restore-snapshot/xfconf.txt | 8 ++++++++ bin/backup.sh | 18 ++++++++++++++++++ bin/restore.sh | 11 +++++++++++ 5 files changed, 64 insertions(+) create mode 100644 assets/themes/restore-snapshot/gtk-3.0-settings.ini create mode 100644 assets/themes/restore-snapshot/gtk-4.0-settings.ini create mode 100644 assets/themes/restore-snapshot/xfconf.txt diff --git a/assets/themes/restore-snapshot/gtk-3.0-settings.ini b/assets/themes/restore-snapshot/gtk-3.0-settings.ini new file mode 100644 index 0000000..dd2d180 --- /dev/null +++ b/assets/themes/restore-snapshot/gtk-3.0-settings.ini @@ -0,0 +1,15 @@ +[Settings] +gtk-application-prefer-dark-theme=true +gtk-button-images=true +gtk-cursor-theme-name=DMZ-White +gtk-cursor-theme-size=24 +gtk-decoration-layout=icon:minimize,maximize,close +gtk-enable-animations=true +gtk-font-name=Ubuntu 10 +gtk-icon-theme-name=NexusOS +gtk-menu-images=false +# gtk-modules=colorreload-gtk-module:window-decorations-gtk-module +gtk-primary-button-warps-slider=false +gtk-theme-name=NexusOS +gtk-toolbar-style=3 +gtk-xft-dpi=98304 diff --git a/assets/themes/restore-snapshot/gtk-4.0-settings.ini b/assets/themes/restore-snapshot/gtk-4.0-settings.ini new file mode 100644 index 0000000..4dd0147 --- /dev/null +++ b/assets/themes/restore-snapshot/gtk-4.0-settings.ini @@ -0,0 +1,12 @@ +[Settings] +gtk-application-prefer-dark-theme=true +gtk-theme-name=NexusOS +gtk-cursor-theme-name=DMZ-White +gtk-cursor-theme-size=24 +gtk-decoration-layout=icon:minimize,maximize,close +gtk-enable-animations=true +gtk-font-name=Ubuntu 10 +gtk-icon-theme-name=NexusOS +gtk-modules=colorreload-gtk-module:window-decorations-gtk-module +gtk-primary-button-warps-slider=false +gtk-xft-dpi=98304 diff --git a/assets/themes/restore-snapshot/xfconf.txt b/assets/themes/restore-snapshot/xfconf.txt new file mode 100644 index 0000000..10457a9 --- /dev/null +++ b/assets/themes/restore-snapshot/xfconf.txt @@ -0,0 +1,8 @@ +# NexusOS live desktop wiring — snapshot 2026-05-18T13:42:57-05:00 +# Reference only. Restore is done by assets/themes/install-theme.sh +xsettings /Net/ThemeName = NexusOS +xsettings /Net/IconThemeName = NexusOS +xsettings /Gtk/CursorThemeName = DMZ-White +xsettings /Gtk/CursorThemeSize = 24 +xsettings /Gtk/FontName = Ubuntu 10 +xfwm4 /general/theme = NexusOS diff --git a/bin/backup.sh b/bin/backup.sh index 186bff7..7200e6f 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -1,5 +1,23 @@ #!/bin/bash +# Snapshot the live NexusOS desktop wiring into the repo before mirroring, +# so the backup captures the ACTUAL current state (not just the canonical +# defaults baked into assets/themes/install-theme.sh). This is a reference +# copy for recovery/diffing; install-theme.sh remains the applier on restore. +snap="$HOME/nexus-core/assets/themes/restore-snapshot" +mkdir -p "$snap" +{ + echo "# NexusOS live desktop wiring — snapshot $(date -Is)" + echo "# Reference only. Restore is done by assets/themes/install-theme.sh" + for p in /Net/ThemeName /Net/IconThemeName /Gtk/CursorThemeName \ + /Gtk/CursorThemeSize /Gtk/FontName; do + echo "xsettings $p = $(xfconf-query -c xsettings -p "$p" 2>/dev/null)" + done + echo "xfwm4 /general/theme = $(xfconf-query -c xfwm4 -p /general/theme 2>/dev/null)" +} > "$snap/xfconf.txt" 2>/dev/null || true +cp -f "$HOME/.config/gtk-3.0/settings.ini" "$snap/gtk-3.0-settings.ini" 2>/dev/null || true +cp -f "$HOME/.config/gtk-4.0/settings.ini" "$snap/gtk-4.0-settings.ini" 2>/dev/null || true + lftp sftp://router:2022 << 'LFTP' set sftp:connect-program "ssh -a -x -p 2022" set cmd:interactive yes diff --git a/bin/restore.sh b/bin/restore.sh index c81127e..1a08161 100755 --- a/bin/restore.sh +++ b/bin/restore.sh @@ -36,5 +36,16 @@ echo "" echo "Rebuilding frontend dependencies..." cd "$NEXUS_ROOT/interface/web" && npm install +echo "" +echo "Restoring NexusOS desktop theme..." +theme_installer="$NEXUS_ROOT/assets/themes/install-theme.sh" +if [ -x "$theme_installer" ]; then + "$theme_installer" +elif [ -f "$theme_installer" ]; then + bash "$theme_installer" +else + echo "Warning: $theme_installer not found — skipping theme restore." +fi + echo "" echo "Restore complete. Nexus is ready to start."