diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..48fb3bd --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,70 @@ +# Dotfiles + +Personal dotfiles for macOS and Linux, managed with [dotbot](https://github.com/anishathalye/dotbot). + +## Structure + +``` +dotfiles/ +├── home/ # Config files symlinked into $HOME +│ ├── config/ # ~/.config/* (alacritty, tmux, zsh, bash, etc.) +│ ├── claude/ # Claude Code config +│ ├── bashrc +│ ├── gitconfig +│ ├── tmux.conf +│ ├── vim/ +│ ├── vimrc +│ └── zshenv +├── macos/ # macOS-specific: Brewfile, Caskfiles, iTerm2 config +├── shell/ # Shell scripts (setup, platform installers, clone, ssh) +├── functions/ # Utility scripts +├── fonts/ # Fonts +├── dotbot/ # Dotbot submodule +├── dotbot.default.yaml # Main dotbot config (always applied) +├── dotbot.personal.yaml # Personal brew casks +├── dotbot.setup-once.yaml # One-time setup (macOS defaults, repo clones) +└── install # Main install script +``` + +## Installation + +```sh +# Default setup (symlinks + shell plugins) +./install + +# First-time macOS setup (run once: Xcode tools, macOS defaults, clone repos) +./install setup-once + +# Personal apps (brew cask installs from Caskfile.personal) +./install personal +``` + +## How It Works + +- `./install` runs dotbot with `dotbot.default.yaml` plus any additional configs passed as arguments +- Dotbot creates symlinks from `home/` into `$HOME`, creates directories, and runs shell commands. Folders in `home/config` are symlinked to `~/.config/` +- Platform detection: macOS runs `shell/install_apps_macos.sh`, Linux runs `shell/install_apps_linux.sh` +- Submodules: dotbot, tpm, Vundle.vim, and several zsh/bash plugins — run `git submodule update --init --recursive` if anything is missing + +## Important: `.local` files + +Files matching `*.local` (e.g. `.zshrc.local`, `.gitconfig.local`, `.bash_profile.local`) are **machine-specific overrides** that exist only on the local machine. They are gitignored and not part of this repo. Do not modify, reference, or suggest changes to `.local` files. + +## Adding Config for a New Tool + +1. Put the config file under `home/config//` or directly in `home/` +2. Add a `link:` entry in `dotbot.default.yaml` pointing from the repo path to the target path in `$HOME` +3. If it needs a directory created first, add it under `create:` in the same file +4. Run `./install` to apply + +## Key Configs + +| File | Linked to | +|------|-----------| +| `home/zshenv` | `~/.zshenv` | +| `home/gitconfig` | `~/.gitconfig` | +| `home/config/alacritty/` | `~/.config/alacritty/` | +| `home/config/tmux/` | `~/.config/tmux/` | +| `home/config/vim/` | `~/.vim/` | +| `home/config/zsh/` | `~/.config/zsh/` | +| `home/config/bash/` | `~/.config/bash/` | diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/README.md b/README.md index 83037f1..d8992d5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,29 @@ dotfiles ======== -Some of my dotfiles +Personal dotfiles for macOS and Linux, managed with [dotbot](https://github.com/anishathalye/dotbot). + +## Install + +```sh +git clone --recursive git@github.com:GeorgeSG/dotfiles.git ~/Git/dotfiles +cd ~/Git/dotfiles +./install +``` + +### macOS - first time setup + +```sh +# Installs Xcode tools, sets macOS defaults, clones personal repos +./install setup-once + +# Installs personal apps (Bitwarden, Discord, Spotify, etc.) +./install personal +``` + +### Linux + +```sh +# Default install handles everything - installs apt packages, sets zsh as default shell +./install +``` diff --git a/clone.sh b/clone.sh deleted file mode 100755 index 73e3163..0000000 --- a/clone.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -cd ~/Git/dotfiles - -git clone git@github.com:GeorgeSG/advent-of-code.git ~/Git/advent-of-code -git clone git@github.com:GeorgeSG/gar.dev.git ~/Git/gar.dev -git clone git@github.com:GeorgeSG/lovelace-time-picker-card.git ~/Git/lovelace-time-picker-card -git clone git@github.com:GeorgeSG/PhotonaydenovV2.git ~/Git/PhotonaydenovV2 -git clone git@github.com:GeorgeSG/promptle.git ~/Git/promptle -git clone git@github.com:GeorgeSG/sarah.git ~/Git/sarah -git clone git@github.com:GeorgeSG/sub.rehab.git ~/Git/sub.rehab -git clone git@github.com:GeorgeSG/taxbro.io.git ~/Git/taxbro.io - -git clone git@gitea:GeorgeSG/gardev-startpage.git ~/Git/gardev-startpage diff --git a/dotbot.default.yaml b/dotbot.default.yaml index 5b47f91..84c8e57 100644 --- a/dotbot.default.yaml +++ b/dotbot.default.yaml @@ -8,6 +8,7 @@ - ~/.config - ~/.config/bash - ~/.config/tmux + - ~/.claude - link: # git @@ -39,38 +40,16 @@ ~/.zshenv: home/zshenv ~/.config/zsh: home/config/zsh + # claude code + ~/.claude/skills: home/claude/skills + # mac os ~/.hushlogin: if: '[ `uname` = Darwin ]' path: macos/hushlogin - shell: - - git submodule sync --recursive - # the following have to run after linking ~/.gitconfig - - git update-submodules - - > - git cleanall -f - home/config/tmux/plugins - home/config/bash/bash-git-prompt - home/config/zsh/plugins - home/vim/bundle/ - - # install BD zsh plugin - this needs to happen after the cleanall - - mkdir -p ~/.config/zsh/plugins/bd - - curl https://raw.githubusercontent.com/Tarrasch/zsh-bd/master/bd.zsh > ~/.config/zsh/plugins/bd/bd.zsh - - - stdin: true + - command: ./shell/setup.sh + stdin: true stdout: true stderr: true - command: > - if [ "$(uname)" = "Darwin" ]; then - ./install_macos.sh - fi - - - stdin: true - stdout: true - stderr: true - command: > - if [ "$(uname)" = "Linux" ]; then - ./install_linux.sh - fi diff --git a/dotbot.setup-once.yaml b/dotbot.setup-once.yaml index beb1f02..6bb6ed6 100644 --- a/dotbot.setup-once.yaml +++ b/dotbot.setup-once.yaml @@ -5,11 +5,11 @@ description: Setting Mac OS defaults command: > if [ "$(uname)" = "Darwin" ]; then - xcode-select --install - ./macos/macos_setup.sh + xcode-select -p &>/dev/null || xcode-select --install + ./shell/macos_setup.sh fi - - command: ./clone.sh + command: ./shell/clone.sh description: Cloning Git repos stdout: true quiet: false diff --git a/home/claude/skills/.gitkeep b/home/claude/skills/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/shell/clone.sh b/shell/clone.sh new file mode 100755 index 0000000..11e2d14 --- /dev/null +++ b/shell/clone.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -e + +[ -d ~/Git/advent-of-code ] || git clone git@github.com:GeorgeSG/advent-of-code.git ~/Git/advent-of-code +[ -d ~/Git/gar.dev ] || git clone git@github.com:GeorgeSG/gar.dev.git ~/Git/gar.dev +[ -d ~/Git/lovelace-time-picker-card ] || git clone git@github.com:GeorgeSG/lovelace-time-picker-card.git ~/Git/lovelace-time-picker-card +[ -d ~/Git/PhotonaydenovV2 ] || git clone git@github.com:GeorgeSG/PhotonaydenovV2.git ~/Git/PhotonaydenovV2 +[ -d ~/Git/promptle ] || git clone git@github.com:GeorgeSG/promptle.git ~/Git/promptle +[ -d ~/Git/sarah ] || git clone git@github.com:GeorgeSG/sarah.git ~/Git/sarah +[ -d ~/Git/sub.rehab ] || git clone git@github.com:GeorgeSG/sub.rehab.git ~/Git/sub.rehab +[ -d ~/Git/taxbro.io ] || git clone git@github.com:GeorgeSG/taxbro.io.git ~/Git/taxbro.io + +[ -d ~/Git/gardev-startpage ] || git clone git@gitea:GeorgeSG/gardev-startpage.git ~/Git/gardev-startpage diff --git a/install_linux.sh b/shell/install_apps_linux.sh similarity index 51% rename from install_linux.sh rename to shell/install_apps_linux.sh index 1afcf32..8c318c2 100755 --- a/install_linux.sh +++ b/shell/install_apps_linux.sh @@ -2,13 +2,15 @@ sudo apt-get update sudo apt-get install -y zsh -chsh -s $(which zsh) +zsh_path="$(command -v zsh)" +if [ "$SHELL" != "$zsh_path" ]; then + sudo chsh -s "$zsh_path" "$(id -un)" +fi sudo apt-get install -y \ bash \ btop \ coreutils \ - docker \ duf \ eza \ findutils \ @@ -29,10 +31,12 @@ sudo apt-get install -y \ zsh \ zsh-syntax-highlighting -sudo snap install doggo -sudo snap install dust -# sudo snap install fastfetch -# sudo snap install fd -# sudo snap install jnv -# sudo snap install kondo -# sudo snap install tokei +if command -v snap >/dev/null 2>&1; then + sudo snap install doggo + sudo snap install dust + # sudo snap install fastfetch + # sudo snap install fd + # sudo snap install jnv + # sudo snap install kondo + # sudo snap install tokei +fi diff --git a/install_macos.sh b/shell/install_apps_macos.sh similarity index 92% rename from install_macos.sh rename to shell/install_apps_macos.sh index ddf3610..19911b9 100755 --- a/install_macos.sh +++ b/shell/install_apps_macos.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh # Install Brew -if test ! $(which brew); then +if ! command -v brew &>/dev/null; then /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.bash_profile.local diff --git a/macos/macos_setup.sh b/shell/macos_setup.sh similarity index 100% rename from macos/macos_setup.sh rename to shell/macos_setup.sh diff --git a/shell/setup.sh b/shell/setup.sh new file mode 100755 index 0000000..3b1699e --- /dev/null +++ b/shell/setup.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -e + +git submodule sync --recursive +# the following have to run after linking ~/.gitconfig +git update-submodules +git cleanall -f \ + home/config/tmux/plugins \ + home/config/bash/bash-git-prompt \ + home/config/zsh/plugins \ + home/vim/plugged/ + +# install BD zsh plugin - this needs to happen after the cleanall +mkdir -p ~/.config/zsh/plugins/bd +curl -fsSL https://raw.githubusercontent.com/Tarrasch/zsh-bd/master/bd.zsh \ + > ~/.config/zsh/plugins/bd/bd.zsh + +# Platform-specific +case "$(uname)" in + Darwin) ./shell/install_apps_macos.sh ;; + Linux) ./shell/install_apps_linux.sh ;; +esac diff --git a/ssh.sh b/shell/ssh.sh similarity index 100% rename from ssh.sh rename to shell/ssh.sh