This repository contains a comprehensive dotfiles management system that automates the synchronization, installation, and maintenance of system configurations across different environments.
- Overview
- Getting Started
- Configuration
- Scripts
- Repository Structure
- Usage Examples
- Contributing
- License
This dotfiles repository provides:
- Automated synchronization between your home directory and the repository
- Package management with support for multiple package managers (pacman, yay, apt, brew, etc.)
- Font installation scripts for system fonts
- Configuration file management with automatic backup and restoration
- Multi-system support with OS detection and cross-platform compatibility
- Python 3.6 or higher
- Git
- A
.dotfiles_config
file in your home directory (see Configuration)
-
Clone this repository:
git clone <repository-url> ~/.dotfiles cd ~/.dotfiles
-
Create your
.dotfiles_config
file in your home directory (see examples in the config parser documentation) -
Run the update script to sync your dotfiles:
python scripts/update_dotfiles.py --sync
The system uses a JSON configuration file (.dotfiles_config
) that defines:
- Metadata: Repository information, version, and description
- Package Managers: Supported package managers for your system
- Packages: Applications and tools to install, organized by category
- Fonts: Font packages to install
- Files: Configuration files and directories to manage
The configuration parser (scripts/utils/config_parser.py
) provides comprehensive validation and management of this configuration.
The primary management script with the following capabilities:
--sync
: Synchronize files from your home directory to the repository--push
: Commit and push changes to GitHub--pull
: Pull latest changes from GitHub
--dry-run
: Preview what would be done without making changes--force
: Force operations even with conflicts--create-missing
: Create missing directories automatically--message, -m
: Custom commit message for push operations--verbose, -v
: Enable detailed logging--quiet, -q
: Suppress non-essential output
The script automatically generates several helpful files in system directories:
packages.sh
: Installation script for all packagesfonts.sh
: Installation script for all fontspackages.json
: Detailed package informationfonts.json
: Detailed font informationREADME.md
: Auto-generated documentation for each system configuration
dotfiles/
├── scripts/ # Management scripts
│ ├── update_dotfiles.py # Main management script
│ └── utils/ # Utility modules
│ └── config_parser.py # Configuration parsing and validation
├── LICENSE
└── README.md # This file
# Sync files from home directory and push to GitHub
python scripts/update_dotfiles.py --sync --push
# With custom commit message
python scripts/update_dotfiles.py --sync --push -m "Update i3 configuration"
# See what would be synchronized without making changes
python scripts/update_dotfiles.py --sync --dry-run
# After syncing, install packages on a new system
cd <NAME>
./packages.sh
./fonts.sh
# Update local repository with remote changes
python scripts/update_dotfiles.py --pull
# Force sync even if there are conflicts
python scripts/update_dotfiles.py --sync --force
The scripts include comprehensive error handling and logging:
- Validation: Configuration files are validated before operations
- Backup: Existing files are backed up before being overwritten
- Rollback: Failed operations can be rolled back
- Logging: Detailed logs help troubleshoot issues
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Test thoroughly
- Commit your changes (
git commit -m "Add amazing feature"
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request