Skip to content
birrejanPublic

About

This document details how I do the installation of my initial development environment of a new mac, I hope it helps and remember that this is my configuration and you should not follow it completely

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

mac-setup

One-command provisioning for a fresh Mac. Clone the repo, run ./install.sh, and end up with a fully configured development machine: Homebrew packages, GUI apps, language runtimes, dotfiles, a tiling window manager with a custom menu bar, sensible macOS defaults, SSH keys, and signed commits.

Built around Homebrew + a Brewfile, GNU Stow for dotfiles, and a set of small, idempotent scripts (safe to re-run). Apple Silicon and Intel both supported.


Quick start

One line on a brand-new Mac (installs Command Line Tools, clones, and runs everything):

bash <(curl -fsSL https://raw.githubusercontent.com/birrejan/mac-setup/main/bootstrap.sh)
Or do it manually
xcode-select --install                                              # Command Line Tools
git clone https://github.com/<your-username>/mac-setup.git ~/mac-setup
cd ~/mac-setup && ./install.sh

Useful flags:

./install.sh --yes           # assume "yes" for every confirmation
./install.sh --skip-macos    # everything except the macOS system tweaks
./install.sh --only ssh      # run a single step (see list below)
./install.sh --only doctor   # healthcheck: verify everything is set up

Steps (run in this order, each also runnable via --only <name>): preflight → homebrew → dotfiles → languages → gh-dash → git → ssh → vscode → iterm2 → wm → macos → touchid → doctor.


What gets installed

CLI / shell

Tool Purpose
git, gh Git + GitHub CLI
lazygit, git-delta terminal UI for git; syntax-highlighted diffs in git, lazygit and gh-dash
difftastic syntax-aware diffs that ignore re-indentation and reflowing; one of lazygit's diff views
gh dash PR dashboard, built from the birrejan/gh-dash fork with go (see PR review)
stow symlinks the dotfiles into $HOME
starship shell prompt
mise runtime version manager (Node, Python)
uv, pipx Python package / app managers
fzf, ripgrep, fd, bat, eza, zoxide, jq, btop modern CLI workflow
task, tasksh, taskwarrior-tui Taskwarrior to-do list, in the terminal and the menu bar (see Tasks)
zsh-autosuggestions, zsh-syntax-highlighting, zsh-completions zsh plugins (no framework)
sketchybar the custom menu bar
borders outlines the focused window (JankyBorders)

Languages (via mise)

Node.js (LTS) + Python 3.13, declared in dotfiles/mise/.config/mise/config.toml. corepack is enabled for pnpm/yarn. Add more anytime: mise use -g go@latest.

Applications

Category Apps
Terminal / editor iTerm2, VS Code
Window manager / menu bar AeroSpace (tiling), SketchyBar (menu bar), Rectangle, Ice
Launchers / AI Alfred 5, Superwhisper, Claude
Comms Slack, Zoom
Browsers Google Chrome, Firefox
Security / accounts Proton Pass, Proton Mail, Proton VPN, Proton Drive, Yubico Authenticator
Fonts Hack Nerd Font, SketchyBar app font, SF Pro, SF Symbols

Dotfiles (symlinked by Stow)

~/.zshrc, ~/.zshenv, ~/.gitconfig, ~/.gitignore_global, ~/.config/starship.toml, ~/.config/mise/config.toml, ~/.config/aerospace/aerospace.toml, ~/.config/sketchybar/*, ~/.config/lazygit/*, ~/.config/gh-dash/config.yml, ~/.config/task/*, ~/.local/bin/pr-review, ~/.local/bin/task-review, ~/.local/bin/task-open.

macOS defaults (scripts/macos.sh)

Fast key repeat, no press-and-hold, tap-to-click, dark mode, Finder (show extensions / path bar / hidden files / list view), screenshots → ~/Screenshots as PNG, Dock (small, autohide, no recents, stable Spaces). Every block is commented with how to revert.


Window manager + menu bar (AeroSpace + SketchyBar)

These configs were captured from a working machine and are reproduced verbatim.

  • AeroSpace is a tiling window manager. It starts at login, launches SketchyBar, and notifies it on workspace changes. Config: ~/.config/aerospace/aerospace.toml.
  • SketchyBar is the custom top bar: workspace pills, media, calendar, volume, battery, CPU, memory, disk and network cards, a mic/camera indicator and a tools menu. It runs as a Homebrew service. Config: ~/.config/sketchybar/; every control is described in CONTROLS.md. The CPU and memory cards stay hidden until the machine is busy, then turn amber/red; clicking them opens btop. The disk card appears once the drive is 85% full (red from 93%) and the network card only while the Mac is offline. The mic/camera card only appears while either is live. The TASK pill shows the Taskwarrior task you started, or what is due today (see Tasks). The tools menu (⚙ or alt + shift + t) has presentation mode (hides app, media and meeting titles), keep-awake, a focus timer and the audio output picker. An MTG pill appears 30 minutes before a meeting and joins the call in one click. It is fed by a small read-only calendar helper built from native/ToolbarBridge.swift when the bar starts. On a Mac with a camera notch the bar measures it at startup (notch.sh) and keeps every item clear of it: the media card is anchored to the right of the notch, and the memory, disk, network and mic/camera cards each have a twin at position q on the left of it. plugins/notch_apply.sh picks which copy a display draws, and re-runs on display_change. The controller is tested: python3 -m unittest discover -s ~/.config/sketchybar/tests.
  • JankyBorders (borders) outlines the focused window, since tiled windows have no titlebar highlight to show where the keyboard is pointing. AeroSpace starts it. Config: ~/.config/borders/bordersrc.

Key AeroSpace bindings (all use alt)

Keys Action
alt + h/j/k/l focus left/down/up/right
alt + shift + h/j/k/l move window
alt + 1…0 switch to workspace 1–10
alt + shift + 1…0 move window to workspace and follow
alt + f fullscreen
alt + shift + space toggle floating / tiling
alt + slash / alt + comma tiles / accordion layout
alt + r resize mode (then h/j/k/l, enter/esc to exit)
alt + shift + c reload AeroSpace config
alt + shift + p presentation mode (hide titles in the menu bar)
alt + shift + t menu bar tools menu
alt + tab previous workspace

The aerospace.toml [workspace-to-monitor-force-assignment] block references "Built-in Retina Display" — harmless on a single-display Mac; edit it for your monitor layout.


PR review in the terminal (gh-dash + lazygit)

gh dash lists the PRs that need you, and a PR opens in lazygit in the same tab for review.

gh-dash comes from a fork: birrejan/gh-dash, branch personal. It is upstream dlvhdr/gh-dash with these changes merged in, each also on its own branch of the fork so it can go upstream:

Branch Change
feat/toggle-draft W toggles a PR between ready for review and draft
feat/background-keybindings custom keys can set background: true and run without leaving the dashboard
fix/keybinding-merge-keeps-non-strings non-string keybinding fields (like background) survive the config merge
fix/watch-checks-final-state w's notification reports the checks' real final state
fix/ignore-app-check-suites-that-never-start apps that never report a check (Supabase, Claude) no longer show as "in progress"
feat/behind-indicator a column flags PRs whose branch is behind their base, and the preview says it is out-of-date

scripts/gh-dash.sh clones the fork to ~/.local/src/gh-dash, builds it and installs it as the gh dash extension. It never touches an existing checkout. To update: cd ~/.local/src/gh-dash && git pull && go build .

Keys on a PR in gh-dash (~/.config/gh-dash/config.yml):

Key Action
i review in lazygit: the whole PR shows as staged changes in a throwaway worktree
f submit your review (approve / request changes / comment)
I Claude reviews first; its findings land in your pending review. The menu bar's REVIEW pill shows its progress, then the comment count (see CONTROLS.md)
T jump to the Claude task session working on the PR
+ add a Taskwarrior task to review the PR (see Tasks)
W toggle draft / ready for review
R rebase the PR on its base branch, in the background

Inside a review in lazygit (Files panel, ~/.config/lazygit/pr-review.yml): c comments on a line, C lists your pending comments, S submits the review. Comments stay pending, visible only to you, until you submit. | cycles delta, side-by-side, difftastic and plain diffs.

The review commands live in ~/.local/bin/pr-review. When a PR's repo isn't cloned yet, i and I first clone it to the path repoPaths maps it to (~/Projects/<name>). I and T also need the Claude Code orchestrator in ~/Projects/.orchestrator and its second-review skill; without them the dashboard shows an error in its footer.


Tasks (Taskwarrior)

Taskwarrior 3 keeps the to-do list, with a look and a menu bar pill that match the rest of the setup. The config is the task Stow package (~/.config/task/) and the tasks themselves live in ~/.local/share/task, outside the repo.

Command Action
t the next report: pending tasks, most urgent first
tt task today: what is started, overdue, or due or scheduled today
ta Release the DS due:eod +ds add a task
t 3 start / t 3 stop say what you're working on; the menu bar shows it and for how long
td 3 mark task 3 done
tui taskwarrior-tui, to browse, filter and edit from the keyboard (? lists its keys)
task-open 3 open task 3's Jira ticket, PR and any link in its annotations
tasksh, then review weekly pass over the tasks you haven't looked at in a week
  • Colors. graphite.theme maps the SketchyBar palette onto Taskwarrior's 256 colors: the started task in bold orange, due today in orange, due this week in amber, overdue in red, muted headers and striped rows. taskwarrior-tui picks up the same colors.
  • Editing in taskwarrior-tui. e edits the task in a prompt at the bottom of the TUI, filled in with its description, tags, project, priority and due date; change them in place and press Enter. Deleting +tag or project:x from the line leaves it set: write -tag or project: instead. E opens the full task edit form (annotations, jira, pr, wait) in vim, which task 3 edit uses too, instead of VS Code. m, the stock modify key, does nothing.
  • Links. Two fields tie a task to the work behind it: jira:NOVA-1043 and pr:InSpace-GEO/inspace-app#882. The reports show the Jira key; task-open <id>, or 1 on a task in taskwarrior-tui, opens the ticket, the PR and any URL in the annotations.
  • Reviews from gh-dash. + on a PR adds "Review inspace-app#882: <title>" tagged +review, with pr set and jira taken from the branch or title when either names a ticket. A notification names the task, and a PR that already has a pending task isn't added twice. +review adds 4 to a task's urgency, since a waiting review blocks a teammate.
  • Menu bar. The TASK pill shows the started task and for how long; with nothing started, the overdue count in red, or else the next task due today. It is hidden when none of those apply, and turns amber when something falls due within the hour. A Taskwarrior hook (hooks/on-exit.sketchybar) redraws it the moment a task changes. Click it for taskwarrior-tui.

due:today means midnight, so the task counts as overdue all day. Use due:eod, or a time such as due:17:00.


Customization

  • Add/remove apps & tools → edit Brewfile, then brew bundle --file=Brewfile.
  • Enable extra tooling (Docker/OrbStack, kubectl, Terraform, cloud CLIs, Go, watchman, mysql, nmap, tmux, …) → uncomment lines in Brewfile.optional, then brew bundle --file=Brewfile.optional.
  • VS Code extensions → edit vscode/extensions.txt, re-run ./install.sh --only vscode.
  • Prompt → edit dotfiles/starship/.config/starship.toml (live).
  • Shell → edit dotfiles/zsh/.zshrc; machine-specific bits go in ~/.zshrc.local (untracked).

How the dotfiles work

Each subdirectory of dotfiles/ is a Stow package whose internal tree mirrors $HOME. stow symlinks the files into place, so editing a file in the repo edits the live config.

Add a new dotfile:

# e.g. add ~/.config/ghostty/config
mkdir -p dotfiles/ghostty/.config/ghostty
mv ~/.config/ghostty/config dotfiles/ghostty/.config/ghostty/config
stow --dir=dotfiles --target="$HOME" ghostty   # (and add it to PACKAGES in scripts/dotfiles.sh)

Keeping the repo in sync (dump.sh)

The repo links your dotfiles, so edits to ~/.zshrc, ~/.config/sketchybar/*, AeroSpace, etc. already flow back into it live. For the things that aren't symlinks — installed Homebrew packages and VS Code extensions — run the sync-back before migrating or whenever you want a fresh snapshot:

./scripts/dump.sh        # or: ./install.sh --only dump
git diff                 # review what changed
git add -A && git commit -m "sync config" && git push

It:

  • writes a full brew bundle dump to Brewfile.machine (a complete snapshot — never touches your curated Brewfile; diff it to promote anything you want installed by default),
  • refreshes vscode/extensions.txt from the installed extensions,
  • copies any dotfile that isn't already symlinked into the repo (so it's safe on any machine),
  • deliberately skips ~/.gitconfig (curated) and your secret ~/.gitconfig.local.

This makes the next machine migration effectively one command.


Git identity & signed commits

scripts/git.sh prompts once for your name + email and writes them to ~/.gitconfig.local (never committed). The tracked ~/.gitconfig includes that file and configures SSH-based commit signing.

scripts/ssh.sh generates an ed25519 key, loads it into the agent + macOS Keychain, and prints the public key. Add it to GitHub as both an Authentication key and a Signing key so your commits show as Verified:

gh auth login
gh ssh-key add ~/.ssh/id_ed25519.pub --type authentication
gh ssh-key add ~/.ssh/id_ed25519.pub --type signing

Manual follow-ups (printed at the end of install.sh)

  1. Restart the terminal (exec zsh) and restart iTerm2 to load the new config + One Dark profile.
  2. Add the SSH key to GitHub (authentication + signing).
  3. Grant Accessibility permissions (System Settings → Privacy & Security → Accessibility): AeroSpace, Rectangle, Alfred. (Cannot be scripted — macOS security.)
  4. Sign in to apps: Proton, Slack, Claude, Alfred, Superwhisper, Yubico.
  5. Run the healthcheck: ./install.sh --only doctor (everything should be green).

Notes / overlaps

  • AeroSpace + Rectangle are both installed by request, but overlap (tiling vs snapping). Drop either by removing its cask line from the Brewfile.
  • No Mac App Store apps (avoids interactive sign-in). Add mas + mas "App", id: … if you want them.
  • iTerm2 preferences are a manual step; full automation can be added later via PrefsCustomFolder.

Repo layout

mac-setup/
├── bootstrap.sh            # one-line curl entry (CLT + clone + install)
├── install.sh              # orchestrator
├── Brewfile                # everything installed by default
├── Brewfile.optional       # opt-in tooling (commented)
├── Brewfile.machine        # full machine snapshot written by dump.sh (commit it to track state)
├── scripts/                # one idempotent script per concern
│   ├── lib.sh  preflight.sh  homebrew.sh  dotfiles.sh  languages.sh  gh-dash.sh
│   ├── git.sh  ssh.sh  vscode.sh  iterm2.sh  wm.sh  macos.sh
│   └── touchid.sh  doctor.sh  dump.sh
├── dotfiles/               # Stow packages (zsh, git, starship, mise, aerospace, sketchybar, borders,
│                           #   lazygit, gh-dash, task, bin)
├── iterm2/                 # DynamicProfiles/mac-setup.json (font + One Dark theme)
└── vscode/                 # settings.json, keybindings.json, extensions.txt

Verification

./install.sh --only doctor                 # the easy one: green/red healthcheck of everything

# or check pieces manually:
bash -n install.sh scripts/*.sh            # syntax
brew bundle check --file=Brewfile          # all installed?
stow -n -d dotfiles -t ~ zsh git starship mise aerospace sketchybar borders lazygit gh-dash task bin   # dry-run symlinks
mise current && node -v && python -V        # runtimes
git config --get commit.gpgsign             # → true
brew services list | grep sketchybar        # → started

About

This document details how I do the installation of my initial development environment of a new mac, I hope it helps and remember that this is my configuration and you should not follow it completely

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages