This tool is meant to copy, archive and restore the Gnome settings from an user to another

Nicole Portas 52f07b4154 corrected readme 3 tuần trước cách đây
README.md 52f07b4154 corrected readme 3 tuần trước cách đây
gnome-backup fbc7cc91f6 Initial commit 3 tuần trước cách đây

README.md

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 <archive_name.tgz>

  • Dry Run: Use ./gnome-backup --dry-run backup <archive_name.tgz> 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 <archive_name.tgz> <target_home_directory> <target_username>

  • 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.