This repository is my toolkit for setting up and managing my Mac. It handles the heavy lifting of configuring everything I need for a clean macOS environment. I use Dotbot and a custom run script to keep everything in sync. Whether you're here to explore my setup or to look for ideas for your own dotfiles, feel free to dive in and make it your own.
- macOS system: These dotfiles are specifically tailored for macOS.
- Terminal with Full Disk Access: For modifying macOS defaults, ensure your terminal has Full Disk Access.
- Navigate to
System Preferences -> Privacy & Security -> Full Disk Access. - Check your terminal application in the list, or add it if needed.
- Restart your terminal for changes to take effect.
- Navigate to
gitinstalled: If you need to install Homebrew first, checkrun.m4(lines 60-61) for commands.
The run script is the core of this repository, offering automated setup and command-line arguments for various tasks:
-i, --install: Perform a fresh installation (default).-u, --update: Update installed tools and applications.-c, --configure-os: Reconfigure operating system settings.-h, --help: Display help information.
-
Clone the repository:
git clone https://github.com/[USERNAME]/dotfiles.git ~/dotfiles cd ~/dotfiles
-
Add execute permissions:
chmod +x run
-
Run the setup script:
./run
This will perform a fresh installation, set up the environment, and apply macOS configurations.
-
Restart your device for changes to take effect.
-
iTerm Settings: Go to
General -> Preferencesin iTerm and change "Save changes" to Automatically.
-
Shottr Settings: Disable default screenshot keybindings in
System Preferences -> Keyboard -> Keyboard Shortcuts -> Screenshotsafter your first run of Shottr.
- iTerm2 Configuration: The script configures iTerm2 with a custom preferences path (
~/.config/iterm/Preferences) that's created later in the installation process. If iTerm2 encounters errors, rerun the script with./run -u.
Update dotfiles with these steps:
- Edit any file in the repository.
- Run
./run --updateto propagate changes to the Brewfile, symlink dotfiles, and run setup scripts.
For modifications to macos.sh, run ./run --configure-os.
The run script is generated using argbash from the run.m4 template. To modify it:
- Install argbash: https://argbash.readthedocs.io/en/latest/install.html. If dotfiles were set up using this
runscript, check if argbash is installed already as a docker container withargbash -h. - Edit the
run.m4file (using bash syntax highlighting for better clarity). - Generate the
runscript:(Omitargbash run.m4 -c -o run
-cto skip all comments in generated script.)
Optional: Pre-commit Hook
Automate script generation after run.m4 changes using this snippet in the repository root:
if [ -e .git/hooks/pre-commit ]; then
bat ./assets/git_hooks/pre-commit >> .git/hooks/pre-commit
else
cp ./assets/git_hooks/pre-commit .git/hooks/
chmod +x .git/hooks/pre-commit
fi(If bat is not installed, replace it with cat. If you don't have ripgrep, replace rg "run.m4$" with grep "run.m4$" on line 7 of ./assets/git_hooks/pre-commit.)
For issues or questions, please feel free to open an issue.
While I'll strive to respond, do note that this is not an actively maintained project. These dotfiles represent configurations that are tailored to my preferences and may not suit everyone's needs.
Contributions are always welcome! Feel free to create a pull request with your changes or improvements.
This project is licensed under the GNU GPL v3.0 License. See the LICENSE.md file for details.