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-rosettaClone the repository locally
git clone https://github.com/dxnter/dotfiles.git ~/.dotfilesBe 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 backupThe files will be saved inside ~/.dotfiles/backup.
Run the setup script
cd ~/.dotfiles
makeAfter 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 sshSimilarly, 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 gpgThe 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,$PATHexports, 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 = XXXXXXXXThe ~/.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.jsfile 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.txtinside 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_dirsLastly, create symlinks for the newly created files
make linksTo remove all symlinks, run the following
make unlinkThe 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 prefsThe 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.
