#!/bin/bash # CachyOS Setup Snapshot Script # Usage: ./snapshot.sh # Creates timestamped snapshot of all system configuration for clean install reference set -e SNAPSHOT_DIR="snapshots/$(date +%Y-%m-%d_%H-%M-%S)" mkdir -p "$SNAPSHOT_DIR" cd "$SNAPSHOT_DIR" echo "Creating snapshot..." # System info { echo "=== System Information ===" echo "" echo "--- OS ---" cat /etc/os-release echo "" echo "--- Kernel ---" uname -a echo "" echo "--- GPU ---" lspci 2>/dev/null | grep -i vga || echo "Not detected" echo "" echo "--- Display Server ---" echo "Wayland: $XDG_SESSION_TYPE" echo "Display: $DISPLAY" echo "" echo "--- Uptime ---" uptime echo "" echo "--- CPU ---" lscpu 2>/dev/null | grep "Model name" || echo "Not available" echo "" echo "--- RAM ---" free -h 2>/dev/null || cat /proc/meminfo | head -5 } > system-info.txt # Pacman packages { echo "=== Auto-installed packages (dependencies) ===" echo "Count: $(pacman -Qe 2>/dev/null | wc -l)" echo "" pacman -Qe 2>/dev/null echo "" echo "=== All installed packages ===" echo "Count: $(pacman -Q 2>/dev/null | wc -l)" echo "" pacman -Q 2>/dev/null } > pacman-packages.txt # Flatpak { echo "=== Flatpak Applications ===" echo "" flatpak list 2>/dev/null echo "" echo "=== Flatpak Remotes ===" echo "" flatpak remotes 2>/dev/null echo "" echo "=== Flatpak Overrides ===" echo "" flatpak override --show 2>/dev/null } > flatpak-list.txt # GNOME extensions { echo "=== GNOME Extensions ===" echo "" echo "--- User extensions ---" ls -la ~/.local/share/gnome-shell/extensions/ 2>/dev/null || echo "None" echo "" echo "--- System extensions ---" ls -la /usr/share/gnome-shell/extensions/ 2>/dev/null || echo "None" } > gnome-extensions.txt # Theme configuration { echo "=== Theme Configuration ===" echo "" echo "--- GTK Theme ---" gsettings get org.gnome.desktop.interface gtk-theme echo "" echo "--- User Theme ---" gsettings get org.gnome.shell.extensions.user-theme name 2>/dev/null || echo "Not set" echo "" echo "--- Installed Themes ---" ls -la ~/.themes/ 2>/dev/null ls -la ~/.local/share/themes/ 2>/dev/null echo "" echo "--- GTK 3.0 css ---" cat ~/.config/gtk-3.0/gtk.css 2>/dev/null || echo "Not configured" echo "" echo "--- GTK 4.0 css ---" cat ~/.config/gtk-4.0/gtk.css 2>/dev/null || echo "Not configured" echo "" echo "--- macos-like-window-controls ---" ls -la ~/.config/macos-like-window-controls/ 2>/dev/null || echo "Not installed" } > theme-config.txt # GNOME settings gsettings list-recursively > gsettings-dump.txt 2>/dev/null || echo "gsettings dump failed" # GNOME shell specific { echo "=== GNOME Shell Settings ===" echo "" echo "--- Shell ---" gsettings list-recursively org.gnome.shell 2>/dev/null echo "" echo "--- Dash to Dock ---" gsettings list-recursively org.gnome.shell.extensions.dash-to-dock 2>/dev/null } > gnome-shell-settings.txt # Custom shortcuts { echo "=== Keyboard Shortcuts ===" echo "" echo "--- Custom keybindings ---" gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings echo "" echo "--- All media keys ---" gsettings list-recursively org.gnome.settings-daemon.plugins.media-keys } > shortcuts.txt # Display config { echo "=== Display Configuration ===" xrandr 2>/dev/null || echo "Not available" } > display-config.txt echo "Snapshot created: $SNAPSHOT_DIR" echo "Files:" ls -la