Fully automated macOS software installation/configuration, modified system preferences, and extra necessities.
Table of Contents
Run the following commands in the terminal to ensure the latest version of macOS is being used and to install the Xcode Command Line Tools. If you're running a device with an M1 chipset, run the last command to install Rosetta 2.
sudo softwareupdate -i -a
xcode-select --install
# M1 CPU Only
sudo softwareupdate --install-rosetta
Clone the repository locally
git clone https://github.com/dxnter/dotfiles.git ~/.dotfiles
Be aware that the setup script will overwrite existing dotfiles with local versions in this repository. Create a backup if you are not running the dotfiles setup on a fresh macOS installation.
make backup
The files will be saved inside ~/.dotfiles/backup
.
Run the setup script
cd ~/.dotfiles
make
After the installation script is complete and your system restarts, you can generate an SSH key to use with GitHub. After the script runs and the key is copied to the clipboard, a GitHub page will open in your browser. Select New SSH Key at the bottom and paste inside the textbox.
make ssh
Similarly, a GPG key can be generated to sign commits. After the script runs, your public GPG key will be copied to the clipboard and a GitHub page will open in your browser. Select New GPG Key at the bottom and paste inside the textbox.
make gpg
The dotfiles can be easily extended to suit additional local requirements by using the following files:
The ~/.zhrc.local
file will be automatically sourced after all
the other zsh related files, thus, allowing its content
to add to or overwrite the existing aliases, settings, PATH
, etc. This can be beneficial for separating environment specific (work, personal) settings away from the base symlinked files and from version control.
Here is an example:
#!/bin/bash
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set PATH additions.
export PATH="$HOME/.composer/vendor/bin:$PATH"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set local aliases.
alias g="git"
Any other universal modifications to the shell should take place in the appropriate file.
./zsh/.config/zsh/.zshenv
→ Environment variables,$PATH
exports, and global directory paths./zsh/.config/zsh/.aliases
→ Command aliases./zsh/.config/zsh/.zshrc
→ Theme, sourcing, and plugin settings
The ~/.gitconfig.local
file will be automatically included after
the configurations from ~/.gitconfig
, thus, allowing its content
to overwrite or add to the existing Git configurations.
Note: Use ~/.gitconfig.local
to store sensitive information
such as the Git user credentials, e.g.:
[user]
name = John Doe
email = jdoe@example.com
signingKey = XXXXXXXX
The ~/.vimrc.local
file will be automatically sourced after
~/.vimrc
, thus, allowing its content to add or overwrite the
settings from ~/.vimrc
.
Here is an example:
" Disable arrow keys in insert mode.
inoremap <Down> <ESC>:echoe "Use j"<CR>
inoremap <Left> <ESC>:echoe "Use h"<CR>
inoremap <Right> <ESC>:echoe "Use l"<CR>
inoremap <Up> <ESC>:echoe "Use k"<CR>
" Disable arrow keys in normal mode.
nnoremap <Down> :echoe "Use j"<CR>
nnoremap <Left> :echoe "Use h"<CR>
nnoremap <Right> :echoe "Use l"<CR>
nnoremap <Up> :echoe "Use k"<CR>
- Open
about:support
- Next to Profile Folder click Show in Finder
- Close Firefox
- Copy/Paste the
/extras/user.js
file into the profile directory
- Select the uBlock Origin extension widget and Open the dashboard in the bottom right corner
- Under My filters, paste the contents of
extras/ublock-filters.txt
inside and Apply changes - Under Filter lists, enable AdGuard URL Tracking Protection under the Privacy category. Under Custom, select Import and paste the URL of Actually Legitimate URL Shortener Tool.
Naturally, there will be dotfiles of your own that are missing from this repository. Adding them to this directory allows a centralized location to symlink, maintain, and version control.
stow
is used to create symbolic links to your $HOME
directory. An example of the expected folder structure is shown below. The top-level directory should correspond to the name of the package, while the contents will be symlinked relative to your $HOME
directory.
nvim
├── .config
│ └── nvim
│ ├── init.vim
│ └── plug.vim
└── .vimrc
Once the new files are created, the symlink_dirs
file needs to be updated with the directory name.
# Example
echo 'nvim' >> symlink_dirs
Lastly, create symlinks for the newly created files
make links
To remove all symlinks, run the following
make unlink
The standard installation makes modifications to the System Preferences. However, they can also be made independently if you do not wish to run the entire installation.
make prefs
The software installed is loosely categorized to different files inside the system/installs
directory.
Search for Homebrew formulae and casks with the package browser. To add a package in a script, use the following format:
brew_install <readableName> <formulaName> [cask]
# system/installs/dev_tools.sh
brew_install "Docker" "docker"
brew_install "Mullvad" "mullvadvpn" "--cask"
When adding or removing files inside the directory, make the subsequent changes to the main.sh
script. New scripts should also be made executable with chmod +x <filename>
before running the setup.
If you need additional support, please open an issue.
Usage is provided under the MIT License.