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
- Create a new repository: GitHub New Repo
- Copy the SSH or HTTPS URL
GitLab
- Create a new repository: GitLab New Repo
- Copy the SSH or HTTPS URL
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:
- Enter your Git repository URL
- Paste personal access token if using HTTPS
- Enter your email for notifications
- Generate an SSH key if none exists
- Backup conflicting dotfiles to `.dotfiles-backup`
- 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
- GitHub: https://github.com
- GitLab: https://gitlab.com
- Bash Manual: https://www.gnu.org/software/bash/manual/
- GPG: https://gnupg.org/
License
This project is licensed under the GNU General Public License v3. GPL v3