Wednesday, September 3, 2025

Dotfiles manager Project

Check out my current project! 

Dotfiles all in one manager



Dotfiles Manager All-in-One (Version 1.0)

Overview

Dotfiles Manager All-in-One is a Bash script to manage, backup, and restore your dotfiles. It includes optional Thunderbird backup, GPG encryption, SSH management, logging, and notifications.

Features

  • Backup & Restore dotfiles using a bare Git repository
  • SSH key management for GitHub or GitLab
  • Optional Thunderbird backup (emails, settings, extensions)
  • Optional GPG encryption for sensitive files
  • Interactive menu to toggle settings, change email, or trigger backups
  • Automatic logging: backup log and error log
  • Email notifications after backups
  • Cross-platform Git support (GitHub and GitLab)
  • Safe initial checkout: backups conflicting dotfiles to `.dotfiles-backup`
  • Selective backup: excludes large/unnecessary folders like `.cache`, `Downloads`, `Music`, `Videos`, etc.
  • Manual and scheduled backups (cron compatible)
  • Version history tracked via Git commits

Prerequisites

Ensure the following are installed:

  • Git: Install Git
  • GPG (optional for encryption): Install GPG
  • msmtp (optional for email notifications): Install msmtp
  • Zenity / notify-send (optional for GUI notifications)
  • SSH client (for SSH key management)

Step-by-Step Setup

1. Prepare a Git Repository

You can use either GitHub or GitLab.

GitHub

GitLab

2. Clone or Copy Script

Download `dotfiles_manager_allinone.sh` and make it executable:

chmod +x dotfiles_manager_allinone.sh

3. First Run

Run the script:

./dotfiles_manager_allinone.sh

During the first-run setup, you will:

  1. Enter your Git repository URL
  2. Paste personal access token if using HTTPS
  3. Enter your email for notifications
  4. Generate an SSH key if none exists
  5. Backup conflicting dotfiles to `.dotfiles-backup`
  6. Checkout repository into a bare Git setup

4. Interactive Menu

  • Toggle Thunderbird backup
  • Toggle GPG encryption
  • Change notification email
  • Update repository URL
  • Generate/View SSH key
  • Trigger manual backup
  • Exit menu

5. Automatic & Manual Backup

  • Manual: select “Trigger manual backup” from the menu
  • Automatic: schedule weekly via cron:
0 2 * * 0 /bin/bash $HOME/backup_dotfiles.sh >> $HOME/dotfiles_backup.log 2>&1

6. Thunderbird Backup (Optional)

If enabled, the script backs up your Thunderbird profile.

7. GPG Encryption (Optional)

  • Toggle encryption from interactive menu
  • Sensitive dotfiles will be encrypted/decrypted during backup/restore

8. Logs and Notifications

  • Logs: `$HOME/dotfiles_backup.log`
  • Errors: `$HOME/dotfiles_backup_error.log`
  • Email notifications sent to your configured address

9. Restoring Dotfiles

Run the script on a new system to restore your dotfiles safely.

10. Version History

  • v1.0 - Initial release of the all-in-one dotfiles manager

Links & Resources

License

This project is licensed under the GNU General Public License v3. GPL v3

No comments:

Post a Comment

Dotfiles manager Project

Check out my current project!  Dotfiles all in one manager Dotfiles Manager All-in-One (Version 1.0) Overview Dotfiles Manager All-in-One ...