Skip to content

Repository files navigation

dotfiles

Personal dotfiles for macOS (primary), Ubuntu, and CentOS. Uses GNU Stow to symlink config directories into $HOME.

Setup

macOS

Clone and run the bootstrap script:

git clone https://github.com/leoluyi/dotfiles.git ~/.dotfiles \
  && cd ~/.dotfiles \
  && ./bootstrap_macos.sh

To re-run without confirmation prompts:

set -- -f; bash bootstrap_macos.sh

Ubuntu / CentOS

./bootstrap_ubuntu.sh
# or
./bootstrap_centos.sh

Individual Steps

Install applications

./install_apps_macos.sh   # macOS (Homebrew + casks + MAS)
./install_apps_ubuntu.sh  # Ubuntu

macOS setup scripts

macOS-only setup scripts live under scripts/macos/ (run from repo root). Cross-platform installers stay at scripts/ root.

./scripts/macos/setup-macos-preferences.sh        # system defaults (Finder, Dock, etc.)
./scripts/macos/setup-macos-keyboard-shortcuts.sh # import symbolic hotkeys
./scripts/macos/setup-macos-menubar-spacing.sh    # menu bar item spacing
./scripts/macos/setup-macos-bash.sh               # install bash 5.x via Homebrew
./scripts/macos/setup-quicklook-markdown.sh       # make Markdown Preview the Quick Look .md engine
./scripts/macos/fix-quicklook.sh                  # clear quarantine on legacy .qlgenerator plugins
./scripts/macos/setup-espanso-watchdog.sh         # install espanso-watchdog launchd agent
./scripts/macos/disable-espanso-app-login-item.sh # remove espanso's duplicate login item
./scripts/macos/setup-OpenInTerminal-Lite-*.sh    # set OpenInTerminal-Lite default terminal

Stow a specific package

# From repo root
stow -t "$HOME" common_dotfiles
stow -t "$HOME" nvim

# Dry run
stow -n -t "$HOME" common_dotfiles

Secrets & Local Overrides

Never commit credentials or machine-specific settings to this repo. Two escape hatches are auto-sourced by .bash_profile on every shell startup:

~/.secrets/ — credentials and API keys

Create the directory and drop shell files into it. Each file is sourced in alphabetical order.

mkdir -p ~/.secrets

# Example: ~/.secrets/api_keys
cat > ~/.secrets/api_keys <<'EOF'
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="..."
EOF

The directory lives entirely outside the dotfiles repo and should never be committed anywhere.

~/.config/bash/99_extra — local machine overrides

For settings that are real config (not secrets) but shouldn't be shared — e.g., work-specific aliases, host-specific paths. Sourced automatically by .bash_profile as the last file in ~/.config/bash/.

# Example: ~/.config/bash/99_extra
export WORK_PROXY="http://proxy.corp:3128"
alias vpn='openconnect corp.example.com'

This file is gitignored and won't be created by bootstrap. Create it manually as needed.

AI / LLM Shell Integrations

Shell functions via llm CLI (llm-cmd, llm-explain, llm-fix, Alt+a) and fabric-ai (?? general query). Custom fabric patterns are tracked in this repo and symlinked via Stow.

See docs/ai-workflow.md for full setup and usage details.

Claude Code

Custom slash commands live in common_dotfiles/.claude/commands/ and are symlinked via Stow.

See docs/autopilot.md for what /autopilot does — delegation model, branch/worktree isolation rules, naming, verification gate, and hard stops.

Codex CLI

Portable Codex guidance and approval rules live in common_dotfiles/.codex/AGENTS.md and common_dotfiles/.codex/rules/default.rules; those files are symlinked into ~/.codex by the existing common_dotfiles Stow package. Hooks, config.toml, caches, sessions, databases, logs, plugin downloads, credentials, and other machine-specific state remain local and untracked. Stow ignores every .codex entry except the two portable files.

mkdir -p "$HOME/.codex/rules"
stow --dotfiles -R -t "$HOME" common_dotfiles

After Codex or agent plugin updates, run scripts/fix-codex-session-start-hooks.sh to keep Claude-style SessionStart hooks compatible with Codex's JSON output contract.

Cheatsheets

References

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages