- MacOS Setup
- Table of Contents
- Introduction
- 1. Setting Up System Preferences
- 2. Setting up the Development Environment
- 3. Setting up the Terminal
- 4. Setting up the SHELLS
- 5. Install Compilers and Toolchains
- 6. Install CLI Tools
- 7. Install GUI Tools
- 8. Setup SSH for GitHub/GitLab etc
- 9. Change HostName of PC
- 10. Setting up Keyboard Shortcuts
- 11. Basic Configurations
This repo is designed for anyone who is moving from Linux to MacOS for the 1st time. The reason for the switch is simply because of the new Apple Silicon that is being offered. I still pretty much will be using my Linux workflow and tools on the Mac. This guide simply eases in the migration of those tools.
The following environment was developed on an Apple MacBook Air M1 running MacOS Monterey (ver 12.5). You can read more about it here.
As this is a new computer there are a couple tweaks you could make to the System Preferences. These include but aren't limited to:
- Show scroll bar:
-
- Always
- Dock size: set slider to approx 20%
-
- Magnification: set slider to approx 50%.
-
- Automatically hide and show the dock.
- Bluetooth:
- Show in menu bar
- Keyboard brightness:
- Show in menu bar
- Battery
- Show percentage.
- Clock:
- Show date: Always
- Display the time with seconds.
- Spotlight:
- Show in menu bar.
-
Point and click
-
- Secondary click.
-
- Tap to click.
-
-
Scroll and zoom
-
- Scroll direction: Natural
-
- Zoom in and out
-
- Smart zoom
-
- Rotate
-
-
- Automatically adjust brightness
Once all this done run he following commands in the terminal.
# Remove workspace auto-switching by running the following command:
defaults write com.apple.dock workspaces-auto-swoosh -bool NO
# Restart the Dock process
killall Dock
# Enable repeating keys by pressing and holding down keys:
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false # (restart any app that you need to repeat keys in)
# Change the default folder for screenshots
# create screenshots folder
mkdir -p ~/Pictures/Screenshots
# Then run the following command
defaults write com.apple.screencapture location ~/Pictures/Screenshots && killall SystemUIServer
- Install xcode and Homebrew:
source install_homebrew.sh
- Install Rosetta:
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
- Install Kitty and Alacritty
brew install --cask kitty brew install --cask alacritty
- Install a Nerd font.
brew tap homebrew/cask-fonts # my favourite font brew install --cask font-caskaydia-cove-nerd-font # install other fonts (if you want) brew install --cask font-anonymous-pro brew install --cask font-anonymice-nerd-font brew install --cask font-fira-code-nerd-font brew install --cask font-iosevka-nerd-font brew install --cask font-inconsolata-nerd-font brew install --cask font-inconsolata-lgc-nerd-font brew install --cask font-inconsolata-go-nerd-font brew install --cask font-jetbrains-mono-nerd-font brew install --cask font-overpass-nerd-font brew install --cask font-roboto-mono-nerd-font # list all fonts you can install this way brew search "/font-/"
- Install git:
brew install git
- Clone the dotfiles repo.
git clone https://github.com/usman1515/dotfiles.git
- Copy the git config file
.gitconfig
into the$HOME
directory. - Setup alacritty terminal config using the dotfiles repo.
# copy config cp -rv dotfiles/alacritty ~/.config # Download themes repo git clone https://github.com/alacritty/alacritty-theme ~/.config/alacritty/themes
- Setup kitty terminal config using the dotfiles repo.
# copy config cp -rv dotfiles/kitty ~/.config # setup theme kitty +kitten themes
- Install iterm2
brew install --cask iterm2
-
- Make iTerm2 default term.
- General -> selection:
-
- Copied text includes trailing new line.
-
- Applications in terminal may access clipboard.
-
- Appearance -> General -> Status bar location: bottom
- Appearance -> Windows:
-
- Show borders around windows.
-
- Appearance -> Tabs:
-
- Show tab bar even when there is only one tab.
-
- Profile -> General:
- Basics -> name:
dark_profile1
. - Basics -> title:
Name (Job) -- User
. - Icon: Built-in icon for current app.
- working directory:
-
- reuse previous sessions directory.
- Basics -> name:
- Profile -> Colors:
- basic colors -> foreground:
FFFFFF
. - cursor colors -> cursor:
FFFFFF
. - cursor colors -> cursor text :
FFFFFF
. - colors presets: tango dark.
- basic colors -> foreground:
- Profiles -> Text:
-
- blinking cursor.
- Font -> type:
CaskaydiaCove Nerd font Mono Regular
. - Font -> size:
11
. -
- use ligatures.
-
- Profiles -> Window -> Settings for new windows:
- Style: Normal
- Space: Space N
- Profiles -> Terminal -> Scrollback buffer:
-
- unlimited scrollback.
-
- Profiles -> Terminal -> Terminal Emulation:
-
- enable mouse reporting.
-
- Profiles -> Sessions:
-
- Status bar enabled.
- Configure status bar:
- Auto rainbow: Light colors
- Active components:
CPU
,RAM
,Network
.
-
- Keys -> Hotkey -> Create a dedicated hotkey window:
Ctrl
+~
.
- Goto System Preferences -> Users and Groups -> you user -> Login Items:
+
-> Applications -> iTerm. Add it.- Hide
- I use ZSH for everyday usage of the terminal.
- To setup ZSH run the following script.
source setup_zsh.sh
- Copy the zsh config files into the
$HOME
dir. - Source the file:
source ~/.zshrc
- Once complete restart the machine.
- My shell of choice for scripting is BASH.
- To setup BASH run the following script.
source setup_bash.sh
- Copy the bash config files into the
$HOME
dir.
- To install various compilers and tool-chains run the following script.
source install_compilers.sh
- Following compilers and tool-chains are available.
Compiler | Description |
---|---|
git | Git version control |
gcc | GNU GCC and G++ C/C++ compiler |
make | GNU make compile utility |
python 3.10 | Python 3.10 |
openjdk | Development kit for Java |
scala | JVM-based programming language |
rust | Safe, concurrent, practical language |
docker | Container environment |
- To install various cli tools run the following script.
source install_brew_formulae.sh
- Following CLI tools are available.
Tool | Description |
---|---|
curl | Get file from HTTP, FTP server |
wget | Internet file retriever |
grep | GNU grep, egrep and fgrep |
sed | GNU sed |
awk | GNU awk utility |
fzf | Command-line fuzzy finder written in Go |
ripgrep | Search tool like grep and The Silver Searcher |
fd | Simple, fast and user-friendly alternative to find |
tree | Display directories as trees |
exa | Modern replacement for 'ls' |
fortune | Infamous electronic fortune-cookie generator |
cowsay | Configurable talking characters in ASCII art |
fastfetch | Fast, highly customizable system info script |
cmatrix | Console Matrix |
vim | Vi 'workalike' with many additional features |
neovim | Ambitious Vim-fork focused on extensibility and agility |
bat | Clone of cat(1) with syntax highlighting and Git integration |
tmux | Terminal multiplexer |
htop | Improved top (interactive process viewer) |
ncdu | NCurses Disk Usage |
imagemagick | Tools and libraries to manipulate images in many formats |
speedtest-cli | CLI for https://speedtest.net |
youtube-dl | Download YouTube videos from the command-line |
ranger | File Browser |
- To install various cli tools run the following script.
source install_brew_casks.sh
- Following softwares are available.
Application | Description |
---|---|
visual-studio-code | Code Editor |
sublimetext | Text editor for code, markup and prose |
alacritty | GPU-accelerated terminal emulator |
kitty | GPU-based terminal emulator |
firefox | Web Browser |
opera | Web Browser |
joplin | Markdown note taking and to-do application |
notion | App to write, plan, collaborate |
google drive | Client for the Google Drive storage service |
dropbox | Client for the Dropbox cloud storage service |
slack | Team communication and collaboration software |
Desktop client for whatsapp | |
discord | Voice and text chat software |
spotify | Music streaming service |
vlc | Multimedia player |
iina | Free and open-source media player |
qbittorrent | Peer to peer Bitorrent client |
folx | Download manager with a torrent client |
anydesk | Allows connection to a computer remotely |
vnc viewer | Remote desktop application |
steam | Video game digital distribution service |
epicgames | Video game digital distribution service |
keka | File archiver |
rectangle | Move and resize windows |
alt-tab | Enable Windows-like alt-tab |
alfred | Application launcher and productivity software |
raycast | Control your tools with a few keystrokes |
gtkwave | GTK+ based wave viewer |
keycastr | Open-source keystroke visualizer |
balena etcher | Tool to flash OS images to SD cards & USB drives |
- To generate a SSH key run the following script.
source setup_sshkey.sh
- To change the hostname of the PC via terminal enter the following commands:
sudo scutil --get HostName sudo scutil --set HostName <your_host_name>
- To create new and change existing keyboard shortcuts goto: System Preferences -> Keyboard -> Shortcuts
- Some of my shortcut keymappings include:
App | Key Mapping |
---|---|
Launchpad | Option + Space |
To setup configs for various CLi tools including git, neovim, tmux look into the dotfiles repo.
defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock
The following command will arrange all MacOS apps on the 1st page and all installed apps on the other pages.