# AGENTS.md ## Overview Lightweight Bash utility scripts for KDE Konsole configuration backup, cross-device synchronization, and restoration. ## Key Features & Commands - **Backup**: `./backup.sh` - Automatically strips device-specific screen geometry / monitor layouts (`[MainWindow]` section in `konsolerc`) to ensure clean cross-device sync. - Staged in `backups/` with default naming format: `konsole_backup__YYYYMMDD_HHMMSS.zip`. - Prompts user to confirm or edit the backup archive filename before saving. - Enforces a retention policy of max 10 backups (older ones deleted and removed via `git rm` if inside a git repository). - Prompts to commit and push the new backup to git remote. - **Restore**: `./restore.sh [optional_zip_path]` - Supports positional arguments, stdin piping (`echo "file.zip" | ./restore.sh`), and an interactive selection menu if no input is provided. - Sanitizes `konsolerc` to avoid overwriting the target machine's window/screen geometry. - Supports file-by-file diff preview (`[d]`) using `git diff --no-index` or `diff`. - Reads interactive prompts safely from `/dev/tty` when stdin is redirected. ## Target Paths (Relative to `$HOME`) - `.config/konsolerc` (sanitized of `[MainWindow]` geometry) - `.local/share/konsole` (profiles, color schemes, bookmarks, keytabs) - `.local/share/kxmlgui5/konsole` (UI toolbars / actions) - `.config/konsole.notifyrc` - `.config/konsolesshconfig` ## Implementation Details & Conventions - **Shell**: Pure Bash 4+ with `set -euo pipefail`. - **Safety**: Uses `mktemp -d` for temporary staging directories with `trap ... EXIT` cleanup. - **Verification**: Run `bash -n backup.sh restore.sh` to check syntax.