Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Locally, `.claude/settings.json` denies these commands and `.claude/hooks/guard-
|---|---|
| `bootstrap.sh` | Entry point: Homebrew, core formulae, bash files |
| `init/.casks`, `.fonts`, `.npm`, `.osx`, `.shell`, `.gituser` | Install steps, run one at a time with `sh ~/.dotfiles/init/<name>` (see README) |
| `config/shell/` | Shell dotfiles copied into `$HOME` (`.zshrc`, `.bashrc`, ...), plus `zsh/.p10k.zsh` and terminal themes for Hyper, iTerm and Terminal |
| `config/shell/` | Shell dotfiles copied into `$HOME` (`.zshrc`, `.bashrc`, ...), plus `starship.toml` (the prompt config) and terminal themes for Hyper, iTerm and Terminal |
| `config/fonts/` | Font files installed by `init/.fonts` |
| `config/alfred/`, `config/tower/` | App themes |
| `git/.gitconfig` | Global Git config, copied to `~/.gitconfig` by option 3 of `init/.gituser` |
Expand All @@ -45,6 +45,6 @@ git ls-files -z | while IFS= read -r -d '' f; do
done | xargs -0 shellcheck --severity style
```

CI doesn't lint the zsh files (`config/shell/.zshrc`, `.zprofile`, `.zshenv`, `zsh/.p10k.zsh`). Check any you change with `zsh -n <file>`.
CI doesn't lint the zsh files (`config/shell/.zshrc`, `.zprofile`, `.zshenv`). Check any you change with `zsh -n <file>`.

Locally, `.claude/hooks/shellcheck-edited.sh` runs ShellCheck (or `zsh -n`) on each file Claude edits and reports problems back in the same turn.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ sh ~/.dotfiles/init/.osx
# Installs fonts for coding and docs
sh ~/.dotfiles/init/.fonts

# Setups git configuration settings
# Sets up git: author name and email, GitHub sign-in over HTTPS, git config
sh ~/.dotfiles/init/.gituser
```

Expand Down Expand Up @@ -113,19 +113,21 @@ These are listed in `bootstrap.sh`.

- [asciinema](https://asciinema.org/)
- [duti](http://duti.org/)
- [eza](https://eza.rocks/)
- [git-lfs](https://git-lfs.github.com/)
- [git](https://git-scm.com/)
- [howdoi](https://github.com/gleitz/howdoi)
- [hugo](https://gohugo.io/)
- [libav](https://www.libav.org/)
- [ffmpeg](https://ffmpeg.org/)
- [nginx](https://www.nginx.com/)
- [node](https://nodejs.org)
- [now](https://zeit.co/now)
- [openssl](https://www.openssl.org/)
- [pandoc](https://pandoc.org/index.html)
- [python](https://www.python.org/)
- [starship](https://starship.rs/)
- [yarn](https://yarnpkg.com/en/)
- [youtube-dl](https://rg3.github.io/youtube-dl/)
- [yt-dlp](https://github.com/yt-dlp/yt-dlp)
- [zsh](https://www.zsh.org/)

### Screensaver
Expand All @@ -136,7 +138,7 @@ I use the lovely [Aerial screensaver](https://github.com/JohnCoates/Aerial) whic

### Shells

I'm using the oh-my-zsh [pure](https://github.com/sindresorhus/pure) theme.
I use oh-my-zsh with the [Starship](https://starship.rs/) prompt, configured in `config/shell/starship.toml`.

Once the theme has loaded, you might want to replace the shell's startup command in `Preferences` under `Profiles > Shell Tab`:

Expand All @@ -147,20 +149,20 @@ Once the theme has loaded, you might want to replace the shell's startup command
Copy Hyper configuration file to the root folder.

```bash
mv ~Dropbox/Code/dotfiles/config/shell/hyper/hyper.config.js ~/.hyper.js
mv ~/.dotfiles/config/shell/hyper/hyper.config.js ~/.hyper.js
```

![Hyper](https://i.imgur.com/Qvej6BG.png)

#### iTerm 2

Set up sync folder in Preferences to `~/Dropbox/Code/dotfiles/config/shell/iterm` under `General > Preferences`.
Set up sync folder in Preferences to `~/.dotfiles/config/shell/iterm` under `General > Preferences`.

![iTerm 2](https://i.imgur.com/8XcQqsh.png)

#### Terminal

Import `Materialize.terminal` profile from `~/Dropbox/Code/dotfiles/config/shell/terminal/Materialize.terminal`.
Import `Materialize.terminal` profile from `~/.dotfiles/config/shell/terminal/Materialize.terminal`.

![Terminal](https://i.imgur.com/kaqt9BC.png)

Expand Down
38 changes: 26 additions & 12 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# The full color palette is kept for reuse, so not every color is used.
# shellcheck disable=SC2034

# Homebrew asks to confirm every install that pulls in dependencies; skip that
export HOMEBREW_NO_ASK=1

BLACK='\033[0;30m'
RED='\033[0;31m'
GREEN='\033[0;32m'
Expand Down Expand Up @@ -51,31 +54,43 @@ echo "${LGREEN}To run this, you must download & install the latest Xcode and Com
echo " > https://developer.apple.com/xcode/"
echo " > https://developer.apple.com/downloads/"

xcode-select --install
xcode-select -p > /dev/null 2>&1 || xcode-select --install

# function to check if a package exists
check () { type -t "${@}" > /dev/null 2>&1; }

# Homebrew lives in /opt/homebrew on Apple Silicon and /usr/local on Intel,
# and /opt/homebrew is not on the PATH of a new Mac
load_brew () {
if [ -x /opt/homebrew/bin/brew ]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [ -x /usr/local/bin/brew ]; then
eval "$(/usr/local/bin/brew shellenv)"
fi
}

# function to install Homebrew Formulas
install_formula () {
echo ""
echo "${LGREEN}Installing Homebrew Packages...${NC}"

brew install asciinema
brew install duti
brew install eza
brew install gh
brew install git
brew install git-lfs
brew install howdoi
brew install hugo
brew install libav
brew install ffmpeg
brew install nginx
brew install node
brew install openssl
brew install pandoc
brew install python
brew install starship
brew install yarn
brew install youtube-dl
brew install yt-dlp
brew install zsh

# cleanup
Expand All @@ -87,19 +102,12 @@ install_formula () {
cp -rf "${DOTFILES}/config/shell/.bash_aliases" "$HOME/.bash_aliases"
cp -rf "${DOTFILES}/config/shell/.bash_profile" "$HOME/.bash_profile"

echo "${LGREEN}Installing Caskroom, Caskroom versions, Caskroom Fonts and Brew Services${NC}"

# restart terminal to apply changes
echo "✔ ✔ ✔ ✔ ✔
${LGREEN}Bootstrapping complete!
✔ ✔ ✔ ✔ ✔{$NC}"
✔ ✔ ✔ ✔ ✔${NC}"
echo "Quitting terminal now...${NC}"

brew tap homebrew/cask
brew tap homebrew/services
brew tap homebrew/cask-versions
brew tap homebrew/cask-fonts

# Make /Applications the default location of installed Homebrew casks
export HOMEBREW_CASK_OPTS="--appdir=/Applications"

Expand All @@ -124,6 +132,8 @@ touch .hushlogin
echo ""
echo "${LGREEN}Checking if Homebrew is installed...${NC}"

load_brew

if check brew; then
echo ""
echo "${YELLOW}Awesome! Homebrew is installed! Now updating...${NC}"
Expand All @@ -135,12 +145,16 @@ fi
if ! check brew; then
echo "${LGREEN}Downloading and install homebrew${NC}"
echo ""
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
load_brew

# run Brew doctor before anything else
brew doctor
fi

# put Homebrew on the PATH of new terminals, so the init scripts can find it
cp -f "${DOTFILES}/config/shell/.zprofile" "$HOME/.zprofile"

# install Homebrew Formulas
while true; do
read -r -p "Would you like to install Homebrew formulas? [y/n]" answer
Expand Down
1 change: 0 additions & 1 deletion config/shell/.bash_aliases
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ alias home="cd ~ && clear"
alias apps="cd /Applications/"
alias music='cd \"$HOME\"/Music/'
alias movies='cd \"$HOME\"/Movies/'
alias dropbox='cd \"$HOME\"/Dropbox/'
alias pictures='cd \"$HOME\"/Pictures/'
7 changes: 6 additions & 1 deletion config/shell/.zprofile
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
eval "$(/opt/homebrew/bin/brew shellenv)"
# Homebrew lives in /opt/homebrew on Apple Silicon and /usr/local on Intel
if [ -x /opt/homebrew/bin/brew ]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [ -x /usr/local/bin/brew ]; then
eval "$(/usr/local/bin/brew shellenv)"
fi
37 changes: 21 additions & 16 deletions config/shell/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,20 @@ export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

# Homebrew (/opt/homebrew on Apple Silicon, /usr/local on Intel).
# .zprofile sets this up for login shells; this covers the others.
if [ -z "$HOMEBREW_PREFIX" ]; then
if [ -x /opt/homebrew/bin/brew ]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [ -x /usr/local/bin/brew ]; then
eval "$(/usr/local/bin/brew shellenv)"
fi
fi

# nvm, installed with Homebrew
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"
[ -s "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" ] && . "$HOMEBREW_PREFIX/opt/nvm/nvm.sh"
[ -s "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" ] && . "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm"

# Fix invalid input issue
export LC_CTYPE=C
Expand All @@ -31,7 +42,6 @@ alias home="cd $HOME && clear"
alias apps="cd $HOME/Applications/"
alias music="cd $HOME/Music/"
alias movies="cd $HOME/Movies/"
alias dropbox="cd $HOME/Dropbox/"
alias pictures="cd $HOME/Pictures/"

# Set to this to use case-sensitive completion
Expand All @@ -47,15 +57,12 @@ DISABLE_AUTO_TITLE="true"
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
plugins=(git macos ruby zsh-wakatime zsh-syntax-highlighting zsh-autosuggestions)

# Homebrew
export PATH=/usr/local/bin:$PATH

# npm
export PATH=/usr/local/share/npm/bin:$PATH

# Make /Applications the default location of apps
export HOMEBREW_CASK_OPTS="--appdir=/Applications"

# Colorful file listings with icons, when eza is installed
command -v eza > /dev/null && alias ls="eza --icons --group-directories-first"

# Show all files when changing directory
function cd() {
new_directory="$*";
Expand All @@ -65,12 +72,10 @@ function cd() {
builtin cd "${new_directory}" && ls -a
}

# p10k configuration
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet

# Finalizing
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source "$HOMEBREW_PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
source "$HOMEBREW_PREFIX/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
source $ZSH/oh-my-zsh.sh
source /opt/homebrew/share/powerlevel10k/powerlevel10k.zsh-theme

# Starship prompt
command -v starship > /dev/null && eval "$(starship init zsh)"
Loading
Loading