@@ -67,45 +67,47 @@ chsh -s /bin/bash && reset
6767defaults write com.apple.finder AppleShowAllFiles YES
6868# disable google chrome dark mode when Mojave dark mode is enabled
6969defaults write com.google.Chrome NSRequiresAquaSystemAppearance -bool yes
70+ # fit more items in the menu bar [ref](https://apple.stackexchange.com/a/465674/292695)
71+ defaults -currentHost write -globalDomain NSStatusItemSpacing -int 6
72+ defaults -currentHost write -globalDomain NSStatusItemSelectionPadding -int 6
7073```
7174
7275<details ><summary ><b >Apple look & feel optimisations</b ></summary ><p >
7376
7477<!-- TODO convert these to https://github.com/msanders/setup/blob/master/defaults.yaml -->
7578
76- - ` System Preferences/General / `
79+ - ` System Preferences/Appearance / `
7780 - ` Show scroll bars: ` Always
7881 - ` Click in the scroll bar to: ` Jump to the spot that's clicked
79- - ` Recent items: ` 50
8082- ` System Preferences/Keyboard/ `
8183 - Slide ` Key Repeat ` to ` Fast `
8284 - Slide ` Delay Until Repeat ` to tick one before ` Short `
83- - Under ` Text ` , untick/remove everything
84- - Under ` Shortcuts ` , tick ` Use keyboard navigation to move focus between controls ` on the bottom
85- - Under ` Input Sources ` , set keyboard layout to U.S. (remove U.S. International)
86- - Under ` Touch Bar shows ` , choose ` Expanded Control Strip `
85+ - Enable ` Keyboard navigation `
86+ - Under ` Text Input ` , untick/remove all ` Text Replacements... `
8787- ` System Preferences/Security & Privacy/ `
8888 - Under ` FileVault ` , turn on FileVault
8989- ` System Preferences/Accessibility/ `
9090 - Under ` Zoom ` , tick ` Use scroll gesture with modifier keys to zoom: `
9191 - Under ` Display ` , untick ` Shake mouse pointer to locate `
92- - Under ` Mouse & Trackpad /Trackpad Options...` , tick ` Enable dragging/three finger drag `
92+ - Under ` Pointer Control /Trackpad Options...` , tick ` Enable dragging/three finger drag `
9393- ` System Preferences/Trackpad/ `
94- - Under ` Point & Click ` , ticks 0, 1, 1, 0, ` Click Medium `
94+ - Under ` Point & Click ` , set ` Click Medium ` , enable Tap to click
9595 - Under ` Scroll & Zoom ` , ticks 0, 1, 0, 1
96- - Under ` Scroll & Zoom ` , ticks 0, 1, 1, 1, 1, 1, 1, everything four fingers
97- - ` System Preferences/Software Update/ `
98- - Under ` Advanced... ` , untick ` Download new updates when available `
99- - ` System Preferences/Dock/ `
100- - Untick ` Show recent applications in Dock `
101- - Tick ` Turn Hiding On `
96+ - Under ` More Gestures ` , set everything to four fingers, disable ` Swipe between pages ` , disable ` Launchpad ` , enable ` Show Desktop `
97+ - ` System Preferences/Desktop & Dock/ `
98+ - Tick ` Automatically hide and show the Dock `
99+ - Untick ` Show suggested and recent apps in Dock `
100+ - ` System Preferences/Language & Region/ `
101+ - Set ` Number Format ` to 1 234 567.89
102+ - Untick ` Show suggested and recent apps in Dock `
102103- Finder preferences
103104 - ` General `
104105 - ` New Finder windows show: ` home
105106 - ` Advanced `
106107 - Tick ` Show all filename extensions `
107108 - ` When performing a search: ` Search the Current Folder
108109- Finder View Options (go home: <kbd >⌘⇧H</kbd >, then <kbd >⌘J</kbd >)
110+ - Change to list view
109111 - Tick ` Always open in List View `
110112 - Tick ` Browse in List View `
111113 - ` Group by: ` None
@@ -125,6 +127,7 @@ defaults write com.google.Chrome NSRequiresAquaSystemAppearance -bool yes
125127 - Untick ` Add ".txt" extension to plain text files `
126128 - Under ` Plain Text File Encoding ` , select two times ` UTF-8 `
127129- Screenshot ` Options ` (to open: <kbd >⌘⇧5</kbd >)
130+ - Save to ` Clipboard `
128131 - Untick ` Show Floating Thumbnail `
129132
130133</p ></details >
@@ -137,29 +140,19 @@ defaults write com.google.Chrome NSRequiresAquaSystemAppearance -bool yes
137140``` bash
138141# install homebrew (which installs command-line tools)
139142/bin/bash -c " $( curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh) "
140- brew tap homebrew/cask
141143brew tap buo/cask-upgrade # `brew cu -a docker` - https://github.com/buo/homebrew-cask-upgrade#usage
142144# check whether all is good
143145brew doctor
144146
145147# and some essentials
146- # - ruby, gcc-8 are linked in `.bash_profile`
147- # - node@14 (LTS at time of writing) installs npm
148- brew install \
149- git git-lfs gitmoji bash-completion rsync curl openssl readline automake xz zlib \
150- osxfuse sshfs htop ncdu direnv pwgen \
151- gcc rust ruby node sqlite3
152- # check out caveats from command above!
153- # npm installs yarn
154- PATH=" /usr/local/opt/node@14/bin:$PATH " npm install -g yarn
148+ brew install git gitmoji bash-completion rsync curl openssl readline automake xz zlib sshfs htop ncdu direnv pwgen gcc rust sqlite3 libpq
155149```
156150
157151
158152#### iTerm [ nerd font] ( https://github.com/ryanoasis/nerd-fonts/blob/master/readme.md )
159153
160154``` bash
161- brew install --cask iterm2
162- brew install --cask homebrew/cask-fonts/font-inconsolata-lgc-nerd-font
155+ brew install --cask iterm2 font-inconsolata-lgc-nerd-font
163156
164157# some blazing fast rust
165158cargo install ripgrep # rg (search for regex occurrences in directory, fastest regex implementation in the world)
@@ -180,7 +173,6 @@ alias ll="ls --long --sort=age --git --time=modified --time-style=iso"
180173``` bash
181174# Docker CE - docker.com/community-edition - Open Docker.app manually to install helper and to enable CLI
182175brew install --cask docker
183- brew install docker-compose
184176# Sublime Text - sublimetext.com
185177brew install --cask sublime-text
186178# Sublime Merge - sublimemerge.com
@@ -190,11 +182,11 @@ brew install --cask google-chrome
190182# PIA VPN - privateinternetaccess.com - Requires manual install from ~/Library/Caches/Homebrew/downloads
191183brew install --cask private-internet-access
192184# Tunnelblick OpenVPN - tunnelblick.net
193- brew install --cask tunnelblick
185+ # brew install --cask tunnelblick
194186# The Unarchiver - theunarchiver.com
195187brew install --cask the-unarchiver
196- # f.lux - justgetflux.com - In Preferences/Sessions, tick 'Allow Dispklay Sleep'
197- brew install --cask flux
188+ # f.lux - justgetflux.com - In Preferences/Sessions, tick 'Allow Display Sleep'
189+ # brew install --cask flux
198190# VLC - videolan.org/vlc
199191brew install --cask vlc
200192# Slack - slack.com
@@ -206,13 +198,17 @@ brew install --cask zoom
206198# Dropbox - dropbox.com
207199# brew install --cask dropbox
208200# Authy - authy.com - Set Master Password in preferences after init
209- brew install --cask authy
201+ # brew install --cask authy
210202# Jitsi Meet - jit.si
211- brew install --cask jitsi-meet
203+ # brew install --cask jitsi-meet
212204# Maccy - maccy.app
213205brew install --cask maccy
214206# pdflatex - tug.org/mactex/
215207brew install --cask mactex-no-gui
208+ # stats in menu bar https://github.com/exelban/stats
209+ brew install --cask stats
210+ # rectangle window resizer https://github.com/rxhanson/Rectangle
211+ brew install --cask rectangle
216212```
217213
218214
@@ -227,10 +223,6 @@ brew install mas
227223```
228224
229225``` bash
230- # iStat Menus - bjango.com/mac/istatmenus
231- mas install 1319778037
232- # Magnet - magnet.crowdcafe.com
233- mas install 441258766
234226# DaisyDisk - daisydiskapp.com
235227# give full disk access under sysprefs security tab
236228mas install 411643860
@@ -264,16 +256,17 @@ Note: first open Chrome for the first time
264256
265257 # Chrome search engines backup
266258 # restore
267- sqlite3 " ${HOME} /Library/Application Support/Google/Chrome/Default/Web Data" < ./ search-engine-export.sql
259+ sqlite3 " ${HOME} /Library/Application Support/Google/Chrome/Default/Web Data" < " ${HOME} /git/new-mac-setup/ search-engine-export.sql"
268260 # create
269261 (printf ' begin transaction;\n' ; sqlite3 " ${HOME} /Library/Application Support/Google/Chrome/Default/Web Data" ' select short_name,keyword,url,favicon_url from keywords' | awk -F\| ' { printf "REPLACE INTO keywords (short_name, keyword, url, favicon_url) values (' " '" %s" '" ' , ' " '" %s" '" ' , ' " '" %s" '" ' , ' " '" %s" '" ' );\n", $1, $2, $3, $4 }' ; printf ' end transaction;\n' ) > ./search-engine-export.sql
270262 ```
271263- iTerm2 preferences: under ` General/Preferences ` , tick ` Load preferences from a custom folder or URL ` and paste ` ~/git/new-mac-setup ` . Quit iTerm
272- - iStat Menus preferences: ` File/Import Settings... ` , select ` iStat Menus Settings.ismp ` . Drag & drop menu bar items with ⌘+drag
264+ - Stats preferences: in ` General/Import Settings... ` , select ` Stats settings.plist ` . Drag & drop menu bar items with ⌘+drag
265+ - iStat Menus preferences: in ` File/Import Settings... ` , select ` iStat Menus Settings.ismp ` . Drag & drop menu bar items with ⌘+drag
273266- Quickly download audio & video with [ ` yt ` ] ( https://github.com/ddelange/yt )
274267 ``` bash
275268 brew install ddelange/brewformulae/yt
276- ```
269+ ```
277270
278271
279272### [ pyenv] ( https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#command-reference ) and [ pyenv-virtualenv] ( https://github.com/pyenv/pyenv-virtualenv#usage )
@@ -283,24 +276,30 @@ Note: first open Chrome for the first time
283276 eval " $( pyenv init -) "
284277 if which pyenv-virtualenv-init > /dev/null; then eval " $( pyenv virtualenv-init -) " ; fi
285278 ```
286- - Set up latest Python versions
279+ - Set up latest Python versions (this needs the ` LDFLAGS ` and ` CPPFLAGS ` in ` .bash_profile ` ):
287280 ``` bash
288281 brew install pyenv pyenv-virtualenv
289282 # get your favourite python versions - github.com/momo-lab/pyenv-install-latest
290283 git clone https://github.com/momo-lab/pyenv-install-latest.git " $( pyenv root) " /plugins/pyenv-install-latest
291284 git clone https://github.com/concordusapps/pyenv-implict.git " $( pyenv root) " /plugins/pyenv-implict
292285 pyenv install -l | grep ' ^\s*[0-9]' # list all available python versions
293286 pyenv install-latest 2
294- pyenv install-latest 3
287+ pyenv install-latest 3.12
295288 pyenv versions # see currently installed versions
296- pyenv global $( pyenv install-latest --print 3) $( pyenv install-latest --print 2) # set default versions: prefer py3 over py2
289+ pyenv global $( pyenv install-latest --print 3.12 ) $( pyenv install-latest --print 2.7 ) # set default versions: prefer py3 over py2
297290 # install virtualenv 'vv' based latest pyenv Python version 3.x, inheriting installed packages
298- pyenv virtualenv $( pyenv install-latest --print 3) --system-site-packages vv
291+ pyenv virtualenv $( pyenv install-latest --print 3.12 ) --system-site-packages vv312
299292 # same for 'vv27' with python 2.7.x
300- pyenv virtualenv $( pyenv install-latest --print 2) --system-site-packages vv27
293+ pyenv virtualenv $( pyenv install-latest --print 2.7) --system-site-packages vv27
294+ ```
295+ - Auto-activate venv using direnv when cd'ing into a folder containing an ` .envrc ` and ` .env ` :
296+ ``` bash
297+ echo ' export PYENV_VERSION=vv312' >> ~ /.env
298+ ln -s ~ /git/.envrc ~ /.envrc # if it wasn't done already
301299 ```
302300- Manage envs
303301 ``` bash
302+ pyenvls # alias in .bash_profile
304303 pyenv virtualenvs
305304 pyenv virtualenv --system-site-packages < venv-name>
306305 pyenv activate < venv-name>
@@ -312,7 +311,7 @@ Note: first open Chrome for the first time
312311### Terraform
313312
314313``` bash
315- brew install tfenv
314+ brew install tfenv tflint
316315tfenv install
317316tfenv use
318317```
@@ -335,11 +334,12 @@ tfenv use
335334 git config --global core.excludesfile " ~/.gitignore"
336335 ```
337336- Note: it's advised to add [ commit signature verification] ( https://help.github.com/en/articles/managing-commit-signature-verification ) to Git.
338- - [ Generate a GPG key] ( https://help.github.com/en/articles/generating-a-new-gpg-key#generating-a-gpg-key ) and tell Git to use it:
337+ - EITHER get the existing ` ~/.gnupg/ ` from your old machine
338+ - OR [ Generate a GPG key] ( https://help.github.com/en/articles/generating-a-new-gpg-key#generating-a-gpg-key ) and tell Git to use it:
339339 ``` bash
340340 brew install gpg
341- gpg --full-generate-key # recommended settings: enter, 4096 , enter
342- gpg --list-secret-keys --keyid-format LONG # copy the key after 'sec 4096R /'
341+ gpg --full-generate-key # recommended settings: enter, ed25519 , enter
342+ gpg --list-secret-keys --keyid-format LONG # copy the signing key after 'sec ed25519 /'
343343 gpg --armor --export < key-here> # paste this key at github.com/settings/keys
344344 git config --global user.signingkey < key-here>
345345 git config --global commit.gpgsign true
0 commit comments