Skip to content

Commit 340e5dc

Browse files
committed
⬆️ Update to macOS 15.1 Sequoia
1 parent 12d5c4b commit 340e5dc

File tree

4 files changed

+273
-82
lines changed

4 files changed

+273
-82
lines changed

.bash_profile

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,42 @@
11
# homebrew
2-
export PATH="/usr/local/sbin:/usr/local/bin:$PATH"
3-
export PATH="${HOME}/.cargo/bin:$PATH" # rust binary installation path
2+
eval "$(/opt/homebrew/bin/brew shellenv)"
3+
#export PATH="/usr/local/sbin:/usr/local/bin:$PATH"
4+
export PATH="${HOME}/.cargo/bin:${PATH}" # rust binary installation path
45
# keg-only installs
5-
export PATH="/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/2.7.0/bin:$PATH"
6-
export PATH="/usr/local/opt/icu4c/bin:/usr/local/opt/icu4c/sbin:$PATH"
7-
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/icu4c/lib/pkgconfig"
8-
export PATH="/Library/TeX/texbin:$PATH" # mactex binary installation path (brew cask install mactex)
9-
10-
# homebrew bash completion https://docs.brew.sh/Shell-Completion#configuring-completions-in-bash
11-
if type brew &>/dev/null; then
12-
HOMEBREW_PREFIX="$(brew --prefix)"
13-
if [[ -r "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh" ]]; then
14-
source "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh"
15-
else
16-
for COMPLETION in "${HOMEBREW_PREFIX}/etc/bash_completion.d/"*; do
17-
[[ -r "$COMPLETION" ]] && source "$COMPLETION"
18-
done
19-
fi
20-
fi
21-
22-
# iterm integration
23-
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
24-
# init zoxide (rust) when available
25-
eval "$(zoxide init bash)" || true
26-
6+
# libpq, icu, curl, mactex binary installation path (brew install --cask mactex-no-gui)
7+
export PATH="/opt/homebrew/opt/libpq/bin:/opt/homebrew/opt/icu4c/bin:/opt/homebrew/opt/icu4c/sbin:/opt/homebrew/opt/curl/bin:/Library/TeX/texbin:${PATH}"
8+
export PKG_CONFIG_PATH="/opt/homebrew/opt/libpq/lib/pkgconfig:/opt/homebrew/opt/icu4c/lib/pkgconfig:/opt/homebrew/opt/curl/lib/pkgconfig:/opt/homebrew/opt/zlib/lib/pkgconfig:${PKG_CONFIG_PATH}"
9+
# gcc setup (LDFLAGS and CPPFLAGS are collected from all caveats from the initial `brew install` in README)
10+
export CC="gcc" # system clang, or alternatively /opt/homebrew/opt/gcc@14/gcc-14
11+
export CXX="gcc" # system clang, or alternatively /opt/homebrew/opt/gcc@14/gcc-14
12+
export LDFLAGS="-L/opt/homebrew/opt/libpq/lib -L/opt/homebrew/opt/curl/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/libpostal/lib ${LDFLAGS}"
13+
export CPPFLAGS="-I/opt/homebrew/opt/libpq/include -I/opt/homebrew/opt/curl/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/libpostal/include ${CPPFLAGS}"
2714

15+
[[ -r "/opt/homebrew/etc/profile.d/bash_completion.sh" ]] && . "/opt/homebrew/etc/profile.d/bash_completion.sh"
2816

2917
# pyenv direnv
3018

31-
export PYENV_ROOT="$HOME/.pyenv"
32-
export PATH="$PYENV_ROOT/bin:$PATH"
3319
export PROMPT_COMMAND='history -a;history -c;history -r'
34-
eval "$(pyenv init --path)"
35-
eval "$(pyenv init -)"
20+
export PYENV_ROOT="${HOME}/.pyenv"
21+
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
22+
eval "$(pyenv init - bash)"
3623
eval "$(pyenv virtualenv-init -)"
3724
eval "$(direnv hook bash)" # direnv hook last so that `export PYENV_VERSION=vv` in local .env is exported first, and gets picked up by pyenv-virtualenv
3825
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
3926

4027
# add PYENV_VERSION=vv311 to your .env instead (see direnv in README)
4128
# pyenv activate vv311
4229

30+
# iterm integration
31+
( test -e "${HOME}/.iterm2_shell_integration.bash" || curl -sSL "https://iterm2.com/shell_integration/bash" -o "${HOME}/.iterm2_shell_integration.bash" ) && source "${HOME}/.iterm2_shell_integration.bash"
32+
# init zoxide (rust) when available
33+
eval "$(zoxide init bash)" || true
4334

4435
# exports
4536

4637
export LC_ALL=en_US.UTF-8
4738
export LANG=en_US.UTF-8
48-
export EDITOR='subl -w'
49-
export CC="/usr/local/bin/gcc-8"
50-
export CXX="/usr/local/bin/g++-8"
51-
# export HOMEBREW_CC="/usr/local/bin/gcc-8"
52-
# export HOMEBREW_CXX="/usr/local/bin/g++-8"
39+
export EDITOR='subl -w' # sublime-text
5340
export GPG_TTY=$(tty)
5441
export BASH_SILENCE_DEPRECATION_WARNING=1
5542

@@ -70,14 +57,15 @@ alias ll='ls --long --sort=age --git --time=modified --time-style=iso'
7057
alias h='history | tail -n 25'
7158
alias cls='printf "\033c"'
7259
alias dff='icdiff --highlight --line-numbers --numlines=3'
73-
alias gcc='gcc-8'
7460
alias moji='git status && git add . && pre-commit && gitmoji -c'
7561
alias git-summary='~/git/git-summary/git-summary'
7662
alias s='subl'
7763
alias sm='smerge'
7864
alias xdg-open='open'
65+
alias htop='sudo htop'
7966
alias pyenvls='pyenv virtualenvs | grep --invert-match "/envs/"'
8067
alias i="
68+
type uv || pip install uv
8169
uv pip install ipython-autotime ipdb rich ipython pandas~=2.0
8270
8371
ipython -i -c '

README.md

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -67,45 +67,47 @@ chsh -s /bin/bash && reset
6767
defaults write com.apple.finder AppleShowAllFiles YES
6868
# disable google chrome dark mode when Mojave dark mode is enabled
6969
defaults 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
141143
brew tap buo/cask-upgrade # `brew cu -a docker` - https://github.com/buo/homebrew-cask-upgrade#usage
142144
# check whether all is good
143145
brew 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
165158
cargo 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
182175
brew install --cask docker
183-
brew install docker-compose
184176
# Sublime Text - sublimetext.com
185177
brew 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
191183
brew 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
195187
brew 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
199191
brew 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
213205
brew install --cask maccy
214206
# pdflatex - tug.org/mactex/
215207
brew 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
236228
mas 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
316315
tfenv install
317316
tfenv 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

Comments
 (0)