Very simple dotfiles boostrap inspired by dotbot.
config.sh- configuration file defining symlinks and installation stepsrun.sh- main installer that processes config and creates symlinksinstall.sh- convenient wrapper script (recommended entry point)
Example configs in config/ and scripts/ directories show typical usage patterns - customize them for your setup.
Fork this repository or copy the main files to get started.
./install.sh # Full installation (uses config.sh)
./install.sh --dry-run # Preview changes without executing
./install.sh --verbose # Detailed output with debug info
./run.sh -c config.sh # Use run.sh directly with specific config
cat config.sh | ./run.sh # Pipe config via stdin
./run.sh --links-only # Only process symlinks (skip steps)
./run.sh --steps-only # Only run steps (skip symlinks)Configuration can be provided via:
- Parameter:
./run.sh -c config.sh - Pipe:
cat config.sh | ./run.sh - Default:
config.shin the same directory asrun.sh(auto-detected)
Config structure
INIT=(
"initialization_command"
"setup_command"
)
LINKS=(
"source:target"
"source2:target2"
)
STEPS=(
"command"
"command2"
)- Initialization commands executed before everything else
- Run in current shell to preserve environment changes (unlike STEPS)
- Perfect for sudo management, environment variables, prerequisites
- Comments allowed with
#prefix - Optional - if not defined, installation proceeds normally
- Format:
"repo-relative-source:absolute-or-~-destination" - Source paths relative to repository root
- Destinations support
~for home directory or absolute paths - Comments allowed with
#prefix
- Shell commands executed sequentially from repository root
- Use
|| truefor optional steps that may fail - Avoid interactive commands
- Comments allowed with
#prefix
- Execution Order: INIT → LINKS → STEPS (initialization runs before acquiring lock)
- Environment Preservation: INIT commands run in current shell, preserving environment variables
- Backups: Existing files are backed up to
~/.dotfiles-backup-YYYYmmdd-HHMMSS/preserving original paths. Prefersrsync -aif available, falls back to portablecp -pPR. - Idempotency: Correct existing symlinks are left untouched. Regular files identical to sources are not backed up again before replacement.
- Locking: Prevents concurrent runs using
~/.dotfiles-install.lock. If a previous run crashed, remove the lock directory to proceed.
This project is in the public domain. Feel free to use, modify, and distribute as needed.
This dotfiles installer draws inspiration from tools like dotbot but emphasizes simplicity and minimal dependencies.