diff --git a/.chezmoiscripts/run_once_after_dock.sh b/.chezmoiscripts/run_once_after_dock.sh index 0ec4b45..061387c 100755 --- a/.chezmoiscripts/run_once_after_dock.sh +++ b/.chezmoiscripts/run_once_after_dock.sh @@ -29,9 +29,10 @@ defaults write com.apple.dock show-recents -bool false add_app_to_dock "Chrome" add_app_to_dock "Ghostty" -add_app_to_dock "Visual Studio Code" add_app_to_dock "Obsidian" +add_app_to_dock "Visual Studio Code" add_app_to_dock "Slack" +add_app_to_dock "Claude" add_app_to_dock "Spotify" add_folder_to_dock "$HOME/Downloads" diff --git a/.chezmoiscripts/run_onchange_after_tmux.sh.tmpl b/.chezmoiscripts/run_onchange_after_tmux.sh.tmpl new file mode 100755 index 0000000..d2c066e --- /dev/null +++ b/.chezmoiscripts/run_onchange_after_tmux.sh.tmpl @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# dot_tmux.conf hash: {{ include "dot_tmux.conf" | sha256sum }} +set -e +{{- if eq .chezmoi.arch "arm64" }} +eval "$(/opt/homebrew/bin/brew shellenv)" +{{- else }} +eval "$(/usr/local/bin/brew shellenv)" +{{- end }} + +if [ ! -d "$HOME/.tmux/plugins/tpm" ]; then + git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm +fi + +"$HOME/.tmux/plugins/tpm/bin/install_plugins" diff --git a/.chezmoiscripts/run_onchange_before_packages.sh.tmpl b/.chezmoiscripts/run_onchange_before_packages.sh.tmpl index b91f7f2..9f652c3 100755 --- a/.chezmoiscripts/run_onchange_before_packages.sh.tmpl +++ b/.chezmoiscripts/run_onchange_before_packages.sh.tmpl @@ -19,10 +19,6 @@ fi $(brew --prefix)/opt/fzf/install --key-bindings --completion --no-update-rc || true -if [ ! -d "$HOME/.tmux/plugins/tpm" ]; then - git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm -fi - brew cleanup || true echo "Homebrew packages installed" diff --git a/README.md b/README.md index b251be2..b42e5a0 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@
-**Already using these?** `chezmoi update && chezmoi apply` +**Already using these?** `chezmoi update` --- @@ -16,6 +16,15 @@ ### 1. Before leaving the old Mac +Check the repo has everything: + +```bash +chezmoi status # managed files edited outside the repo → chezmoi re-add +brew bundle cleanup --file ~/.dotfiles/Brewfile # installed but not in Brewfile → add or ignore +``` + +Never pass `--force` to `cleanup`. It uninstalls everything unlisted, including Apple's apps. + Save these to 1Password: - Raycast settings: Settings → Advanced → Export (`.rayconfig` file) @@ -64,16 +73,12 @@ Then open Terminal and run each command **one at a time**. Wait for each to fini Close Terminal and open Ghostty. Your shell config loads from here on. -1. Add your SSH key to GitHub. Git uses SSH for every GitHub URL, so clones fail until this is done. - ```bash - pbcopy < ~/.ssh/id_ed25519.pub # paste at https://github.com/settings/ssh/new - ssh -T git@github.com # answer "yes" to trust GitHub - ``` -2. Install runtimes. This step failed during install because the key didn't exist yet. - ```bash - cut -d' ' -f1 ~/.tool-versions | xargs -n1 asdf plugin add; asdf install - ``` -3. Start `tmux` and press `prefix + I` to install its plugins. +Add your SSH key to GitHub. Git pushes to GitHub over SSH. + +```bash +pbcopy < ~/.ssh/id_ed25519.pub # paste at https://github.com/settings/ssh/new +ssh -T git@github.com # answer "yes" to trust GitHub +``` ### 5. Set up apps @@ -90,6 +95,25 @@ These need a login or a manual step: Work tools stay out of this repo. Set them up on the work Mac. +## Existing Mac + +Adds what's missing. Preview first: `~` may hold edits you want to keep. + +1. Clone without applying. + ```bash + brew install chezmoi + chezmoi init --source ~/.dotfiles helderberto + ``` +2. Preview changes to `~`. Move machine-only bits to `~/.private` first. + ```bash + chezmoi diff + ``` +3. Sign in to the App Store, then apply. `brew bundle` installs only what's missing. + ```bash + chezmoi apply + ``` +4. Do [steps 4 and 5](#4-finish-in-ghostty) for anything not set up yet. + ---