Skip to content

Add KDE Plasma configs and an install/restore script - #2

Open
tjcelaya wants to merge 1 commit into
masterfrom
claude/kde-dotfiles-install-restore-sb7bx5
Open

Add KDE Plasma configs and an install/restore script#2
tjcelaya wants to merge 1 commit into
masterfrom
claude/kde-dotfiles-install-restore-sb7bx5

Conversation

@tjcelaya

Copy link
Copy Markdown
Owner

Pulls in the KDE dotfiles from youngcoder45/My-KDE-Dotfiles and adds an installer that backs up whatever it replaces, with a restore path back out.

kde/

Vendored from upstream commit c2a32eb: KWin, KRunner, Dolphin and Baloo settings, plus fish, kitty, starship, neovim (lazy.nvim), btop, cava, fastfetch, neofetch, and Panel Colorizer presets. Upstream's README is preserved as kde/UPSTREAM-README.md. The Screenshots/ directory (1 MB of PNGs) was left out.

install.sh

./install.sh -n        # preview
./install.sh           # install everything
./install.sh -g kde    # KDE configs only ($XDG_CONFIG_HOME)
./install.sh -g home   # existing shell/editor dotfiles only ($HOME)

Backups are on by default. Before overwriting anything, the current version is copied to ~/.local/share/dotfiles-backups/<YYYYmmdd-HHMMSS>/ along with a manifest.tsv of every target and a meta.txt (date, host, repo commit). --no-backup opts out and warns when you do.

The home group also wires up the two .smw_*.wav files that .bashrc already plays on command success/failure — they land at ~/bin/smw_*.wav, which is where .bashrc looks for them.

Restore

./install.sh --list-backups
./install.sh --restore                # most recent
./install.sh --restore 20260812-0307  # or a specific snapshot
./install.sh --restore -n             # preview the rollback

Restore replays the manifest rather than just copying files back: entries recorded as PRESENT are put back as they were, entries recorded as ABSENT (i.e. the install created them) are removed, and directories the install had to create are pruned if they end up empty. Installing twice snapshots the installed copies the second time, so --restore walks back one install at a time — noted in the README.

Other flags: --merge (copy into an existing directory instead of replacing it wholesale), -y, --backup-dir, $DOTFILES_BACKUP_DIR.

Notes

  • Upstream hardcodes its author's home directory in the fastfetch logo path; the installer rewrites that to your $XDG_CONFIG_HOME after copying.
  • rm -rf targets are guarded — anything outside $HOME aborts the run.
  • These are somebody else's desktop settings: kwinrc and friends will replace your window-manager, shortcut, and panel config. The README says to preview with -n first and to expect a re-login before KDE picks the changes up.

Testing

Exercised against a throwaway $HOME with a mix of pre-existing and absent targets: dry run, full install, -g kde, --merge, --no-backup, --list-backups, and restore. Verified that pre-existing files come back byte-for-byte, installed-from-scratch files are removed, unrelated files survive --merge, and bad --group / missing-backup-ID arguments fail with a clear message.


Generated by Claude Code

Vendors the config files from youngcoder45/My-KDE-Dotfiles (commit c2a32eb)
into kde/: KWin, KRunner, Dolphin and Baloo settings plus fish, kitty,
starship, neovim, btop, cava, fastfetch, neofetch and Panel Colorizer
presets. Upstream's README is kept as kde/UPSTREAM-README.md; the
screenshots were left out.

install.sh copies them to $XDG_CONFIG_HOME, and the existing top-level
dotfiles to $HOME, selectable with -g home|kde|all. Every install first
snapshots the files it is about to overwrite into a timestamped directory
under ~/.local/share/dotfiles-backups with a manifest; --no-backup opts
out.

--restore replays a manifest: files that existed are put back, files the
install created are removed, and directories it had to create are pruned
if empty. --list-backups shows what is available and --dry-run previews
either direction.

Also rewrites the author's hardcoded home directory out of the installed
fastfetch config.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NLJxr12Eup4PRFMsDr7p19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants