# GNOME Settings Backup & Restore A robust bash utility designed to backup, archive, and restore a complete GNOME desktop environment across different user profiles. This script handles the heavy lifting of migrating dconf databases, shell extensions, and visual assets while ensuring correct file ownership on the target system. ## Features - **Dconf Integration**: Automatically dumps and loads the dconf database to preserve system settings. - **Asset Migration**: Captures extensions, backgrounds, fonts, icons, and themes. - **Security Focused**: Aggressively scrubs `keyrings` and `kwalletd` directories to prevent sensitive credential leakage. - **Cross-User Support**: Designed specifically to restore configurations to a different username and home directory. - **Headless Capability**: Includes a helper script to load settings via a temporary D-Bus session if no graphical environment is active. ## Usage ### 1. Backup Run as your current user to create a compressed archive: Bash ``` ./gnome-backup backup ``` - **Dry Run**: Use `./gnome-backup --dry-run backup ` to simulate the process without touching files. ### 2. Restore Restore the archive to a target user profile. **Requires sudo** to fix file ownership. Bash ``` sudo ./gnome-backup restore ``` - **Example**: `sudo ./gnome-backup restore /tmp/setup.tgz /home/guest guest` ### 3. Finalize Log in as the **target user** and execute the generated helper script to apply the dconf settings: Bash ``` ./load_gnome_settings.sh ``` ## Technical Details ### Included Paths The script preserves the following structure: - **Config**: `monitors.xml`, `mimeapps.list`, `gtk-3.0/4.0`, `fontconfig`, `user-dirs.dirs`, `autostart`. - **Local Shares**: `gnome-shell/extensions`, `backgrounds`, `fonts`, `themes`, `icons`. - **Hidden Folders**: `.themes`, `.icons`, `.fonts`. ### Automation The restore process automatically scaffolds standard XDG user directories (Desktop, Downloads, etc.) to ensure GNOME stability upon first login. ## Troubleshooting If you encounter "Permission denied" errors during dconf loading, ensure the `.cache/dconf` directory exists. This script attempts to pre-create this for you during the restore phase.