diff --git a/AGENTS.md b/AGENTS.md index 512ab4d..e064309 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,7 +4,7 @@ This file provides guidance to AI coding agents working on this repository. ## What This Is -A GitHub repo ([dmythro/terminal-setup](https://github.com/dmythro/terminal-setup)) containing a one-command macOS terminal setup script. Designed to be run via `curl | bash` on a fresh Mac. +A GitHub repo ([dmythro/terminal-setup](https://github.com/dmythro/terminal-setup)) containing a one-command macOS / Linux terminal setup script. Designed to be run via `curl | bash` on a fresh Mac or Linux machine (Ubuntu/Debian). ## Files @@ -16,13 +16,17 @@ A GitHub repo ([dmythro/terminal-setup](https://github.com/dmythro/terminal-setu ## Script Structure -The script uses `set -e` and is sequential with interactive prompts (`read -p`). It writes config files inline using **quoted heredocs** (`cat > ~/.file << 'TAG'`) so variables aren't expanded during write. The tmux toggle uses a `__TMUX_TOGGLE__` placeholder in the zshrc heredoc, replaced via `sed -i ''` after writing — this is the only value that needs post-write substitution. +The script uses `set -e` and is sequential with interactive prompts (`read -p`). It writes config files inline using **quoted heredocs** (`cat > ~/.file << 'TAG'`) so variables aren't expanded during write. Two placeholders need post-write substitution: `__TMUX_TOGGLE__` in the zshrc and `__CLIPBOARD_CMD__` in the tmux.conf, both replaced via the `sed_inplace` helper. -`REPO_RAW` (line 9) is used to download `Dmythro.terminal` from the repo at runtime (section 11). +**OS detection** uses `uname -s` to set `IS_MACOS`/`IS_LINUX` booleans at the top. macOS uses Homebrew for packages; Linux (Ubuntu/Debian) uses apt, with curl installers for packages not in apt (starship, bun) and a git clone for zsh-completions. The `sed_inplace()` helper wraps `sed -i ''` (BSD) vs `sed -i` (GNU) — it's the only helper function needed. -Key sections: Homebrew install → core packages (incl. zsh-completions) → optional tmux → optional dev tools (incl. zoxide, delta) → optional AI coding agents → fzf keybindings → delta git config → tmux.conf → .zshrc → starship.toml → Terminal.app profile import → summary output. +`REPO_RAW` (line 9) is used to download `Dmythro.terminal` from the repo at runtime (section 12, macOS only). -`reset-terminal.sh` mirrors this structure with per-section interactive prompts. It replaces `~/.zshrc` with a minimal version (preserving Homebrew/local bin paths) rather than deleting it outright. Packages are left installed by default since they're inert without configs. +Key sections: Homebrew install (macOS only) → core packages → optional tmux → optional dev tools (incl. zoxide, delta) → optional AI coding agents → fzf keybindings (macOS only) → delta git config → tmux.conf → .zshrc → starship.toml → Nerd Font → Terminal.app profile import (macOS only) → summary output. + +The `.zshrc` is cross-platform — it detects paths at runtime (e.g. `[[ -f /opt/homebrew/bin/brew ]]`) rather than using OS-specific placeholders for plugin paths. Autosuggestions, syntax highlighting, and fzf are sourced from whichever path exists (Homebrew or `/usr/share`). + +`reset-terminal.sh` mirrors this structure with per-section interactive prompts. It replaces `~/.zshrc` with a minimal version (preserving Homebrew/local bin paths) rather than deleting it outright. Packages are left installed by default since they're inert without configs. On Linux, it removes apt packages and git-cloned zsh-completions. ## Conventions @@ -31,6 +35,8 @@ Key sections: Homebrew install → core packages (incl. zsh-completions) → opt - The summary is conditional — only shows sections for packages the user chose to install - The script is destructive — it overwrites `~/.zshrc`, `~/.tmux.conf`, and `~/.config/starship.toml` without backup. Don't test on a machine with configs you want to keep. - AI coding agent prompts default to Y for OpenCode and Claude Code, N for the rest +- Terminal.app profile import (section 12) is macOS-only — silently skipped on Linux +- Nerd Font install uses `brew --cask` on macOS, downloads from GitHub releases on Linux ## Terminal Profile Notes @@ -49,4 +55,4 @@ No AI agents are installed or prompted during setup. The final summary lists all - **Gemini CLI** (`brew install gemini-cli`) — Google, open source - **Aider** (`brew install aider`) — multi-model pair programming -The reset script still handles both formula and cask uninstalls for agents that were installed manually. +The reset script still handles both formula and cask uninstalls for agents that were installed manually (macOS). On Linux, the reset script removes apt packages, git-cloned zsh-completions, and optionally bun and Nerd Fonts. diff --git a/README.md b/README.md index aeb3d86..beefac8 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Terminal Setup -A curated one-command macOS terminal setup for **zsh** and the native **Terminal.app**. Installs a fast, modern shell environment with sensible defaults — optimized for speed and AI coding agents. +A curated one-command macOS & Linux terminal setup for **zsh**. Installs a fast, modern shell environment with sensible defaults — optimized for speed and AI coding agents. -While it includes an optional Terminal.app dark theme profile, the shell configuration works in **any terminal emulator** — [iTerm2](https://iterm2.com), [Ghostty](https://ghostty.org), [Alacritty](https://alacritty.org), [Kitty](https://sw.kovidez.net/kitty/), [WezTerm](https://wezfurlong.org/wezterm/), VS Code integrated terminal, etc. The zsh config, prompt, and plugins are terminal-agnostic. +Uses **Homebrew** on macOS and **apt** on Linux (Ubuntu/Debian). The shell configuration works in **any terminal emulator** — Terminal.app, [iTerm2](https://iterm2.com), [Ghostty](https://ghostty.org), [Alacritty](https://alacritty.org), [Kitty](https://sw.kovidez.net/kitty/), [WezTerm](https://wezfurlong.org/wezterm/), GNOME Terminal, VS Code integrated terminal, etc. The zsh config, prompt, and plugins are terminal-agnostic. ## Quick Start @@ -37,7 +37,7 @@ curl -sL https://raw.githubusercontent.com/dmythro/terminal-setup/main/reset-ter | Package | What it does | |---------|-------------| -| [Homebrew](https://brew.sh) | macOS package manager (installed if missing) | +| [Homebrew](https://brew.sh) / apt | macOS package manager (Linux uses apt) | | [fzf](https://github.com/junegunn/fzf) | Fuzzy finder — `Ctrl+R` for history, `Ctrl+T` for files | | [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) | Fish-like ghost text suggestions from history | | [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) | Commands turn green/red as you type | @@ -59,7 +59,7 @@ Plus a hand-tuned `~/.zshrc` with: Includes a mouse-friendly `~/.tmux.conf`: - Auto-starts per terminal session (toggle with `USE_TMUX=false` in `~/.zshrc`) -- Mouse support: drag to select and copy, drag borders to resize, scroll to browse +- Mouse support: drag to select and copy (goes to system clipboard), drag borders to resize, scroll to browse - 50K scrollback, true color support, no escape delay - See [Keyboard Shortcuts](#keyboard-shortcuts) for keybindings @@ -88,7 +88,7 @@ The setup includes an optional section for installing AI coding agent CLIs via H > Each agent requires its own API key or login. See the respective docs for setup. -### Optional — Terminal.app Profile +### Optional — Terminal.app Profile (macOS only) A dark theme profile (`Dmythro.terminal`) imported directly into Terminal.app: @@ -142,7 +142,7 @@ These only work inside a tmux session. For the full list of default tmux keys, s | Context | How to copy | |---------|-------------| -| **tmux** | Mouse drag to select — automatically copied to macOS clipboard on release. Or `Prefix + [` to enter copy mode, select text, press `Enter` or `y` to copy. | +| **tmux** | Mouse drag to select — automatically copied to system clipboard on release. Or `Prefix + [` to enter copy mode, select text, press `Enter` or `y` to copy. | | **Terminal.app** | Native selection with `Cmd+C` to copy (standard macOS behavior) | ## AI Coding Agents Comparison @@ -179,12 +179,14 @@ To get the most out of Starship's icons and glyphs on macOS 26, use a [Nerd Font > **Note:** Terminal.app on macOS 26 only renders `calt` (contextual alternates) — it does not support `liga`/`dlig` ligatures. For full ligature rendering, use [iTerm2](https://iterm2.com), [Kitty](https://sw.kovidgoyal.net/kitty/), or [WezTerm](https://wezfurlong.org/wezterm/). -| Font | By | Ligatures | Box Drawing | Install | -|------|----|:---------:|:-----------:|---------| -| [Geist Mono](https://www.programmingfonts.org/#geistmono) | Vercel | Yes (SS11) | Partial | `brew install --cask font-geist-mono-nerd-font` | -| [Cascadia Code](https://www.programmingfonts.org/#cascadiacode) | Microsoft | Yes | Complete | `brew install --cask font-caskaydia-mono-nerd-font` | -| [Monaspace](https://monaspace.githubnext.com) | GitHub | Yes | Complete | `brew install --cask font-monaspice-nerd-font` | -| [Iosevka](https://www.programmingfonts.org/#iosevka) | Belleve Invis | Yes | Complete | `brew install --cask font-iosevka-nerd-font` | +| Font | By | Ligatures | Box Drawing | Install (macOS) | Install (Linux) | +|------|----|:---------:|:-----------:|---------|---------| +| [Geist Mono](https://www.programmingfonts.org/#geistmono) | Vercel | Yes (SS11) | Partial | `brew install --cask font-geist-mono-nerd-font` | [GeistMono.tar.xz](https://github.com/ryanoasis/nerd-fonts/releases/latest/download/GeistMono.tar.xz) | +| [Cascadia Code](https://www.programmingfonts.org/#cascadiacode) | Microsoft | Yes | Complete | `brew install --cask font-caskaydia-mono-nerd-font` | [CascadiaCode.tar.xz](https://github.com/ryanoasis/nerd-fonts/releases/latest/download/CascadiaCode.tar.xz) | +| [Monaspace](https://monaspace.githubnext.com) | GitHub | Yes | Complete | `brew install --cask font-monaspice-nerd-font` | [Monaspace.tar.xz](https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Monaspace.tar.xz) | +| [Iosevka](https://www.programmingfonts.org/#iosevka) | Belleve Invis | Yes | Complete | `brew install --cask font-iosevka-nerd-font` | [Iosevka.tar.xz](https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Iosevka.tar.xz) | + +> **Linux font install:** Download the `.tar.xz`, extract to `~/.local/share/fonts/`, then run `fc-cache -fv`. The setup script handles this automatically for Monaspace. **Geist Mono** — ligatures are off by default; enable Stylistic Set 11 (SS11) in your terminal's font settings. Box drawing characters were added in v1.5.0 but [some intersections are missing](https://github.com/vercel/geist-font/issues/64) (e.g. `├`), causing fallback to the system font — TUI apps with tables (lazygit, btop, opencode) may show gaps at those points. **Cascadia Code** and **Monaspace** have complete box drawing and render gapless tables. @@ -192,13 +194,13 @@ To get the most out of Starship's icons and glyphs on macOS 26, use a [Nerd Font **Iosevka** — extremely narrow and customizable, good for small screens and split panes. -After installing, set the font in Terminal.app: **Settings > Profiles > Font > Change**. +After installing, set the font in your terminal: on macOS, **Terminal.app > Settings > Profiles > Font > Change**; on Linux, use your terminal emulator's font settings. > Preview and compare fonts at [programmingfonts.org](https://www.programmingfonts.org). ## Why This Setup -Setting up a productive terminal on a fresh Mac takes time. This script does it in one command with interactive prompts — no frameworks, no plugin managers, no bloat. Just Homebrew packages and plain config files. +Setting up a productive terminal on a fresh Mac or Linux machine takes time. This script does it in one command with interactive prompts — no frameworks, no plugin managers, no bloat. Just Homebrew packages and plain config files. The zsh configuration is optimized for working with AI coding agents: @@ -236,7 +238,7 @@ curl -sL https://raw.githubusercontent.com/dmythro/terminal-setup/main/reset-ter - [ ] Interactive TUI installer via `npx` / `bunx` (checkboxes, step previews, config presets) - [ ] Profile presets (minimal, full, agent-focused) -- [ ] Linux support +- [x] Linux support (Ubuntu/Debian via apt) - [ ] Dotfile backup before overwriting ## License diff --git a/TODO-Linux.md b/TODO-Linux.md new file mode 100644 index 0000000..3839fbe --- /dev/null +++ b/TODO-Linux.md @@ -0,0 +1,248 @@ +# Plan: Add Linux Support to Terminal Setup Scripts + +## Context + +The scripts currently only work on macOS. Users want to run the same setup on Linux. The approach: detect the OS, use **apt** on Linux (not Homebrew/Linuxbrew) since that's what Linux users expect, and use **Homebrew** on macOS as before. Target: Ubuntu/Debian (apt). The architecture allows adding dnf/pacman later. + +Key insight: make the `.zshrc` itself cross-platform by checking which paths exist at runtime — no placeholders needed for plugin paths. + +## Files to Modify + +- `setup-terminal.sh` — main changes +- `reset-terminal.sh` — mirror changes +- `README.md` — update for Linux +- `AGENTS.md` — update for Linux + +## Package Availability on apt (Ubuntu 24.04) + +| Package | apt? | apt name | Notes | +|---------|------|----------|-------| +| zsh | Yes | `zsh` | | +| fzf | Yes | `fzf` | Shell integration at `/usr/share/doc/fzf/examples/` | +| zsh-autosuggestions | Yes | `zsh-autosuggestions` | Source at `/usr/share/zsh-autosuggestions/` | +| zsh-syntax-highlighting | Yes | `zsh-syntax-highlighting` | Source at `/usr/share/zsh-syntax-highlighting/` | +| zsh-completions | **No** | — | Git clone from GitHub | +| starship | **No** | — | Official curl installer | +| tmux | Yes | `tmux` | | +| gh | **No** | — | Official apt repo setup | +| bun | **No** | — | Official curl installer | +| ripgrep | Yes | `ripgrep` | | +| fd | Yes | `fd-find` | Binary is `fdfind`, needs alias | +| zoxide | Yes | `zoxide` | | +| git-delta | Yes | `git-delta` | | +| xclip | Yes | `xclip` | For tmux clipboard on Linux | + +--- + +## Changes: setup-terminal.sh + +### 1. Header + OS detection (after `set -e`) +- Update header comment: "macOS / Linux Terminal Setup" +- Add OS detection booleans: `IS_MACOS` / `IS_LINUX` via `uname -s` + +### 2. Helper function +- `sed_inplace()` — wraps `sed -i ''` (BSD) vs `sed -i` (GNU). Only helper needed. + +### 3. Package installation (Sections 1-2, 4) + +**Section 1 — Homebrew (macOS only):** +```bash +if $IS_MACOS; then + # existing Homebrew install logic unchanged +fi +``` + +**Section 2 — Core packages:** +```bash +if $IS_MACOS; then + brew install fzf zsh-autosuggestions zsh-syntax-highlighting zsh-completions starship + chmod go-w "$(brew --prefix)/share/zsh-completions" "$(brew --prefix)/share" +else + sudo apt update + sudo apt install -y zsh fzf zsh-autosuggestions zsh-syntax-highlighting xclip + # zsh-completions: clone from GitHub (not in apt) + [[ ! -d "$HOME/.zsh/zsh-completions" ]] && \ + git clone --depth 1 https://github.com/zsh-users/zsh-completions ~/.zsh/zsh-completions + # starship: not in apt on 24.04 + command -v starship &>/dev/null || curl -sS https://starship.rs/install.sh | sh -s -- -y +fi +``` + +**Section 3 — tmux:** +```bash +if $IS_MACOS; then brew install tmux; else sudo apt install -y tmux; fi +``` + +**Section 4 — Dev tools:** +```bash +if $IS_MACOS; then + brew install gh bun ripgrep fd zoxide git-delta +else + sudo apt install -y ripgrep fd-find zoxide git-delta + # gh: official apt repo + if ! command -v gh &>/dev/null; then + # (official keyring + repo setup, then sudo apt install gh) + fi + # bun: official installer + command -v bun &>/dev/null || curl -fsSL https://bun.sh/install | bash + # fd alias hint (binary is fdfind on Debian/Ubuntu) +fi +``` + +### 4. fzf keybindings (Section 6) +```bash +if $IS_MACOS; then + yes | $(brew --prefix)/opt/fzf/install --key-bindings --completion --no-update-rc 2>/dev/null || true +fi +# On Linux, fzf shell integration is sourced directly in .zshrc from /usr/share/doc/fzf/examples/ +``` + +### 5. tmux.conf clipboard (Section 8) +- Use `__CLIPBOARD_CMD__` placeholder for the 6 `pbcopy` instances +- After writing heredoc, replace with `sed_inplace`: + - macOS: `pbcopy` + - Linux: `xclip -selection clipboard` (or `xsel`/`wl-copy` if found) +- Update comment from "macOS clipboard" to "system clipboard" + +### 6. .zshrc — make it cross-platform at runtime (Section 9) + +**Key idea:** Instead of placeholders, write a .zshrc that detects paths at runtime. This keeps the heredoc readable. + +**Homebrew shellenv (line 168):** +```zsh +# --- Homebrew (macOS) --- +[[ -f /opt/homebrew/bin/brew ]] && eval "$(/opt/homebrew/bin/brew shellenv)" +``` +This silently does nothing on Linux. Clean. + +**Completions fpath (line 199):** +```zsh +# --- Tab completion --- +# Homebrew zsh-completions (macOS) +[[ -d "$(brew --prefix 2>/dev/null)/share/zsh-completions" ]] && FPATH="$(brew --prefix)/share/zsh-completions:$FPATH" +# Git-cloned zsh-completions (Linux) +[[ -d "$HOME/.zsh/zsh-completions/src" ]] && fpath=($HOME/.zsh/zsh-completions/src $fpath) +autoload -Uz compinit && compinit +``` + +**Autosuggestions (line 207):** +```zsh +# Fish-like autosuggestions (grey ghost text, → to accept) +for _f in {$(brew --prefix 2>/dev/null),/usr}/share/zsh-autosuggestions/zsh-autosuggestions.zsh; do + [[ -f "$_f" ]] && source "$_f" && break +done +``` + +**Syntax highlighting (line 212):** +```zsh +for _f in {$(brew --prefix 2>/dev/null),/usr}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh; do + [[ -f "$_f" ]] && source "$_f" && break +done +``` + +**fzf (line 215):** +```zsh +# fzf fuzzy search (Ctrl+R for history, Ctrl+T for files) +if [[ -f ~/.fzf.zsh ]]; then + source ~/.fzf.zsh +elif [[ -d /usr/share/doc/fzf/examples ]]; then + source /usr/share/doc/fzf/examples/key-bindings.zsh + source /usr/share/doc/fzf/examples/completion.zsh +fi +``` + +**Zoxide (line 223):** Already cross-platform (`command -v zoxide`). No change. + +**tmux auto-start (line 176):** Add `$DISPLAY` / `$WAYLAND_DISPLAY` checks: +```zsh +if [[ "$USE_TMUX" == "true" ]] && command -v tmux &>/dev/null && [[ -z "$TMUX" ]] && \ + [[ "$TERM_PROGRAM" == "Apple_Terminal" || "$TERM_PROGRAM" == "iTerm.app" || -n "$DISPLAY" || -n "$WAYLAND_DISPLAY" ]]; then +``` + +**macOS 26 true color (line 229):** Wrap in `COLORTERM` check (Linux terminals usually set it): +```zsh +if [[ -z "$COLORTERM" ]] && [[ "$(sw_vers -productVersion 2>/dev/null)" == 26.* ]]; then + export COLORTERM=truecolor +fi +``` + +**fd alias:** Add near other aliases: +```zsh +command -v fdfind &>/dev/null && ! command -v fd &>/dev/null && alias fd='fdfind' +``` + +**Local binaries:** Add `~/.bun/bin` to PATH for Linux bun install: +```zsh +export PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" +``` + +### 7. sed -i call (line 262) +- Use `sed_inplace` for `__TMUX_TOGGLE__` replacement (only remaining placeholder) +- Add `__CLIPBOARD_CMD__` replacement for tmux.conf if tmux was installed + +### 8. Font install (Section 11) +- macOS: `brew install --cask font-monaspice-nerd-font` (unchanged) +- Linux: download from `github.com/ryanoasis/nerd-fonts/releases` to `~/.local/share/fonts`, run `fc-cache -fv` + +### 9. Terminal.app profile (Section 12) +- Wrap entire section in `if $IS_MACOS` — silently skipped on Linux + +### 10. Summary output (Section 13) +- "Quit Terminal.app (Cmd+Q)" → "Close and reopen your terminal" on Linux +- Option as Meta key reminder → macOS only +- "Cmd+D" tmux note → macOS only +- Font message → "installed to ~/.local/share/fonts" on Linux +- AI agents: `--cask` → `npm` for claude-code/codex on Linux +- "another Mac" → "another machine" on Linux +- Add `chsh -s $(which zsh)` reminder on Linux if shell isn't zsh + +--- + +## Changes: reset-terminal.sh + +### 1. OS detection + `sed_inplace` helper (same as setup) + +### 2. Minimal .zshrc (Section 1) +Replace hardcoded `/opt/homebrew` with the same runtime-check pattern: +```zsh +[[ -f /opt/homebrew/bin/brew ]] && eval "$(/opt/homebrew/bin/brew shellenv)" +``` + +### 3. Terminal.app profile reset (Section 3) +- Wrap `defaults read/write` block in `if $IS_MACOS` + +### 4. Package uninstall (Section 5) +- macOS: existing brew/cask uninstall (unchanged) +- Linux: `sudo apt remove` for apt-installed packages, `rm -rf ~/.zsh/zsh-completions`, prompt to remove nerd font from `~/.local/share/fonts` + +### 5. Summary text (Section 6) +- "Cmd+Q" → conditional macOS/Linux text + +--- + +## Changes: README.md + +- Header: "one-command macOS terminal setup" → "one-command macOS & Linux terminal setup" +- Homebrew row: "macOS package manager" → "macOS package manager (Linux uses apt)" +- tmux clipboard: "macOS clipboard" → "system clipboard" +- Terminal.app profile section: note "(macOS only)" +- Nerd Fonts install commands: add Linux alternative +- "fresh Mac" → "fresh Mac or Linux machine" +- Roadmap: `- [x] Linux support` + +## Changes: AGENTS.md + +- "macOS terminal setup script" → "macOS / Linux terminal setup script" +- Document OS detection and `sed_inplace` helper +- Note: macOS uses Homebrew, Linux uses apt +- Note which sections are macOS-only + +--- + +## Verification + +1. Read through both scripts checking all conditional blocks +2. Verify no leftover `__CLIPBOARD_CMD__` placeholders in output files +3. Verify .zshrc plugin source paths work on both OS (path-exists checks) +4. macOS: should behave identically to current version +5. Linux: verify apt install, font download, skipped Terminal.app section, fzf integration paths diff --git a/reset-terminal.sh b/reset-terminal.sh index 22423c2..bb47af9 100755 --- a/reset-terminal.sh +++ b/reset-terminal.sh @@ -1,12 +1,19 @@ #!/bin/bash # ============================================================================= -# macOS Terminal Reset +# macOS / Linux Terminal Reset # Undoes setup-terminal.sh — removes configs and optionally uninstalls packages # Run: curl -sL https://raw.githubusercontent.com/dmythro/terminal-setup/main/reset-terminal.sh | bash # ============================================================================= set -e +# --- OS detection --- +case "$(uname -s)" in + Darwin) IS_MACOS=true; IS_LINUX=false ;; + Linux) IS_MACOS=false; IS_LINUX=true ;; + *) echo "❌ Unsupported OS: $(uname -s)"; exit 1 ;; +esac + echo "🧹 Terminal setup reset" echo " This will undo changes made by setup-terminal.sh" echo "" @@ -20,8 +27,8 @@ if [[ $REMOVE_CONFIGS =~ ^[Yy]$ ]]; then # Write minimal .zshrc that preserves Homebrew and local bin paths cat > ~/.zshrc << 'ZSHRC' # Minimal .zshrc — preserves Homebrew and local binaries -eval "$(/opt/homebrew/bin/brew shellenv)" 2>/dev/null || true -export PATH="$HOME/.local/bin:$PATH" +[[ -f /opt/homebrew/bin/brew ]] && eval "$(/opt/homebrew/bin/brew shellenv)" +export PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" ZSHRC echo " ✅ ~/.tmux.conf and starship.toml removed" echo " ✅ ~/.zshrc replaced with minimal version" @@ -37,15 +44,17 @@ if [[ -f ~/.fzf.zsh ]] || [[ -f ~/.fzf.bash ]]; then fi fi -# --- 3. Reset Terminal.app profile --- -CURRENT_PROFILE=$(defaults read com.apple.Terminal "Default Window Settings" 2>/dev/null || true) -if [[ "$CURRENT_PROFILE" == "Dmythro" ]]; then - read -p "🎨 Reset Terminal.app profile to Basic? [y/N] " -n 1 -r RESET_PROFILE < /dev/tty - echo "" - if [[ $RESET_PROFILE =~ ^[Yy]$ ]]; then - defaults write com.apple.Terminal "Default Window Settings" -string "Basic" - defaults write com.apple.Terminal "Startup Window Settings" -string "Basic" - echo " ✅ Terminal.app profile reset to Basic" +# --- 3. Reset Terminal.app profile (macOS only) --- +if $IS_MACOS; then + CURRENT_PROFILE=$(defaults read com.apple.Terminal "Default Window Settings" 2>/dev/null || true) + if [[ "$CURRENT_PROFILE" == "Dmythro" ]]; then + read -p "🎨 Reset Terminal.app profile to Basic? [y/N] " -n 1 -r RESET_PROFILE < /dev/tty + echo "" + if [[ $RESET_PROFILE =~ ^[Yy]$ ]]; then + defaults write com.apple.Terminal "Default Window Settings" -string "Basic" + defaults write com.apple.Terminal "Startup Window Settings" -string "Basic" + echo " ✅ Terminal.app profile reset to Basic" + fi fi fi @@ -59,8 +68,8 @@ if command -v tmux &>/dev/null && tmux list-sessions &>/dev/null 2>&1; then fi fi -# --- 5. Uninstall Homebrew packages --- -if command -v brew &>/dev/null; then +# --- 5. Uninstall packages --- +if $IS_MACOS && command -v brew &>/dev/null; then echo "" read -p "📦 Uninstall packages installed by setup-terminal.sh? [y/N] " -n 1 -r UNINSTALL_PKGS < /dev/tty echo "" @@ -81,6 +90,54 @@ if command -v brew &>/dev/null; then done echo " ✅ Packages uninstalled" fi +elif $IS_LINUX; then + echo "" + read -p "📦 Uninstall packages installed by setup-terminal.sh? [y/N] " -n 1 -r UNINSTALL_PKGS < /dev/tty + echo "" + if [[ $UNINSTALL_PKGS =~ ^[Yy]$ ]]; then + APT_PKGS=(fzf zsh-autosuggestions zsh-syntax-highlighting tmux ripgrep fd-find zoxide git-delta xclip gh) + INSTALLED_APT=() + for pkg in "${APT_PKGS[@]}"; do + if dpkg -l "$pkg" 2>/dev/null | grep -q "^ii"; then + INSTALLED_APT+=("$pkg") + fi + done + if [[ ${#INSTALLED_APT[@]} -gt 0 ]]; then + echo " Removing apt packages: ${INSTALLED_APT[*]}" + sudo apt remove -y "${INSTALLED_APT[@]}" 2>/dev/null || true + fi + # Remove git-cloned zsh-completions + if [[ -d "$HOME/.zsh/zsh-completions" ]]; then + echo " Removing ~/.zsh/zsh-completions..." + rm -rf "$HOME/.zsh/zsh-completions" + fi + # Remove starship if installed via curl + if command -v starship &>/dev/null && [[ "$(which starship)" == "/usr/local/bin/starship" ]]; then + echo " Removing starship..." + sudo rm -f /usr/local/bin/starship + fi + # Remove bun if installed via curl + if [[ -d "$HOME/.bun" ]]; then + read -p " Remove bun (~/.bun)? [y/N] " -n 1 -r REMOVE_BUN < /dev/tty + echo "" + if [[ $REMOVE_BUN =~ ^[Yy]$ ]]; then + rm -rf "$HOME/.bun" + echo " ✅ bun removed" + fi + fi + # Remove Nerd Font + FONT_DIR="$HOME/.local/share/fonts" + if ls "$FONT_DIR"/*Monasp* &>/dev/null 2>&1; then + read -p " Remove Monaspace Nerd Font from $FONT_DIR? [y/N] " -n 1 -r REMOVE_FONT < /dev/tty + echo "" + if [[ $REMOVE_FONT =~ ^[Yy]$ ]]; then + rm -f "$FONT_DIR"/*Monasp* + fc-cache -fv "$FONT_DIR" >/dev/null 2>&1 + echo " ✅ Monaspace Nerd Font removed" + fi + fi + echo " ✅ Packages uninstalled" + fi fi # --- 6. Done --- @@ -89,5 +146,9 @@ echo "✅ Reset complete." if [[ $REMOVE_CONFIGS =~ ^[Yy]$ ]]; then echo " ~/.zshrc replaced with minimal version (Homebrew + ~/.local/bin paths kept)" fi -echo " Quit Terminal.app (Cmd+Q) and reopen to start fresh." +if $IS_MACOS; then + echo " Quit Terminal.app (Cmd+Q) and reopen to start fresh." +else + echo " Close and reopen your terminal to start fresh." +fi echo "" diff --git a/setup-terminal.sh b/setup-terminal.sh index 329dda9..ad28c96 100755 --- a/setup-terminal.sh +++ b/setup-terminal.sh @@ -1,6 +1,6 @@ #!/bin/bash # ============================================================================= -# macOS Terminal Setup +# macOS / Linux Terminal Setup # Run: curl -sL https://raw.githubusercontent.com/dmythro/terminal-setup/main/setup-terminal.sh | bash # ============================================================================= @@ -8,26 +8,55 @@ set -e REPO_RAW="https://raw.githubusercontent.com/dmythro/terminal-setup/main" +# --- OS detection --- +case "$(uname -s)" in + Darwin) IS_MACOS=true; IS_LINUX=false ;; + Linux) IS_MACOS=false; IS_LINUX=true ;; + *) echo "❌ Unsupported OS: $(uname -s)"; exit 1 ;; +esac + +# --- Helper: cross-platform sed -i --- +sed_inplace() { + if $IS_MACOS; then + sed -i '' "$@" + else + sed -i "$@" + fi +} + echo "🚀 Setting up terminal..." -# --- 1. Install Homebrew if missing --- -if ! command -v brew &>/dev/null; then - echo "📦 Installing Homebrew..." - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - eval "$(/opt/homebrew/bin/brew shellenv)" +# --- 1. Install Homebrew if missing (macOS only) --- +if $IS_MACOS; then + if ! command -v brew &>/dev/null; then + echo "📦 Installing Homebrew..." + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + eval "$(/opt/homebrew/bin/brew shellenv)" + fi fi # --- 2. Core packages --- echo "📦 Installing core packages..." -brew install fzf zsh-autosuggestions zsh-syntax-highlighting zsh-completions starship -chmod go-w "$(brew --prefix)/share/zsh-completions" "$(brew --prefix)/share" +if $IS_MACOS; then + brew install fzf zsh-autosuggestions zsh-syntax-highlighting zsh-completions starship + chmod go-w "$(brew --prefix)/share/zsh-completions" "$(brew --prefix)/share" +else + sudo apt update + sudo apt install -y zsh fzf zsh-autosuggestions zsh-syntax-highlighting xclip + # zsh-completions: not in apt, clone from GitHub + if [[ ! -d "$HOME/.zsh/zsh-completions" ]]; then + git clone --depth 1 https://github.com/zsh-users/zsh-completions ~/.zsh/zsh-completions + fi + # starship: not in apt on 24.04 + command -v starship &>/dev/null || curl -sS https://starship.rs/install.sh | sh -s -- -y +fi # --- 3. Optional tmux --- echo "" read -p "📦 Install tmux for split panes? (auto-starts per session) [y/N] " -n 1 -r INSTALL_TMUX < /dev/tty echo "" if [[ $INSTALL_TMUX =~ ^[Yy]$ ]]; then - brew install tmux + if $IS_MACOS; then brew install tmux; else sudo apt install -y tmux; fi echo " ✅ tmux installed" fi @@ -36,14 +65,34 @@ echo "" read -p "📦 Install dev tools? (gh, bun, ripgrep, fd, zoxide, delta) [y/N] " -n 1 -r INSTALL_DEV < /dev/tty echo "" if [[ $INSTALL_DEV =~ ^[Yy]$ ]]; then - brew install gh bun ripgrep fd zoxide git-delta + if $IS_MACOS; then + brew install gh bun ripgrep fd zoxide git-delta + else + sudo apt install -y ripgrep fd-find zoxide git-delta + # gh: official apt repo + if ! command -v gh &>/dev/null; then + (type -p wget >/dev/null || sudo apt install -y wget) \ + && sudo mkdir -p -m 755 /etc/apt/keyrings \ + && out=$(mktemp) && wget -nv -O "$out" https://cli.github.com/packages/githubcli-archive-keyring.gpg \ + && cat "$out" | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ + && sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ + && sudo apt update \ + && sudo apt install -y gh + rm -f "$out" + fi + # bun: official installer + command -v bun &>/dev/null || curl -fsSL https://bun.sh/install | bash + fi echo " ✅ Dev tools installed" fi # --- 5. AI coding agents (listed in summary, not installed) --- -# --- 6. Install fzf key bindings --- -yes | $(brew --prefix)/opt/fzf/install --key-bindings --completion --no-update-rc 2>/dev/null || true +# --- 6. Install fzf key bindings (macOS only — Linux sources from /usr/share in .zshrc) --- +if $IS_MACOS; then + yes | $(brew --prefix)/opt/fzf/install --key-bindings --completion --no-update-rc 2>/dev/null || true +fi # --- 7. Configure git to use delta (if installed) --- if command -v delta &>/dev/null; then @@ -124,27 +173,44 @@ set -g status-left-length 20 set -g window-status-current-style "fg=cyan,bold" set -g window-status-style "fg=colour244" -# --- Window titles (passed to Terminal.app tab) --- +# --- Window titles (passed to terminal tab) --- set -g set-titles on set -g set-titles-string "#{pane_title}" setw -g automatic-rename on -# --- Clipboard (all copy operations go to macOS clipboard) --- -set -s copy-command "pbcopy" +# --- Clipboard (all copy operations go to system clipboard) --- +set -s copy-command "__CLIPBOARD_CMD__" # Mouse drag copies to clipboard -bind -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy" -bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy" +bind -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "__CLIPBOARD_CMD__" +bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "__CLIPBOARD_CMD__" # Keyboard copy -bind -T copy-mode Enter send-keys -X copy-pipe-and-cancel "pbcopy" -bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy" -bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy" +bind -T copy-mode Enter send-keys -X copy-pipe-and-cancel "__CLIPBOARD_CMD__" +bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "__CLIPBOARD_CMD__" +bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "__CLIPBOARD_CMD__" # --- Pane borders --- set -g pane-border-style "fg=colour238" set -g pane-active-border-style "fg=cyan" TMUX + +# Replace clipboard placeholder with OS-appropriate command +if $IS_MACOS; then + CLIP_CMD="pbcopy" +else + if command -v wl-copy &>/dev/null; then + CLIP_CMD="wl-copy" + elif command -v xclip &>/dev/null; then + CLIP_CMD="xclip -selection clipboard" + elif command -v xsel &>/dev/null; then + CLIP_CMD="xsel --clipboard --input" + else + CLIP_CMD="xclip -selection clipboard" + fi +fi +sed_inplace "s|__CLIPBOARD_CMD__|$CLIP_CMD|g" ~/.tmux.conf + # Reload config if inside tmux (new settings take effect without restart) [[ -n "$TMUX" ]] && tmux source-file ~/.tmux.conf 2>/dev/null || true fi @@ -164,16 +230,17 @@ cat > ~/.zshrc << 'ZSHRC' # Zsh Config # ============================================================================= -# --- Homebrew --- -eval "$(/opt/homebrew/bin/brew shellenv)" 2>/dev/null || true +# --- Homebrew (macOS) --- +[[ -f /opt/homebrew/bin/brew ]] && eval "$(/opt/homebrew/bin/brew shellenv)" -# --- Local binaries (claude, etc.) --- -export PATH="$HOME/.local/bin:$PATH" +# --- Local binaries (claude, bun, etc.) --- +export PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" # --- tmux auto-start --- # Set USE_TMUX=false in ~/.zshrc to disable tmux auto-start USE_TMUX=__TMUX_TOGGLE__ -if [[ "$USE_TMUX" == "true" ]] && command -v tmux &>/dev/null && [[ -z "$TMUX" ]] && [[ "$TERM_PROGRAM" == "Apple_Terminal" || "$TERM_PROGRAM" == "iTerm.app" ]]; then +if [[ "$USE_TMUX" == "true" ]] && command -v tmux &>/dev/null && [[ -z "$TMUX" ]] && \ + [[ "$TERM_PROGRAM" == "Apple_Terminal" || "$TERM_PROGRAM" == "iTerm.app" || -n "$DISPLAY" || -n "$WAYLAND_DISPLAY" ]]; then tmux new-session && exit fi @@ -195,8 +262,10 @@ bindkey "^[[A" up-line-or-beginning-search bindkey "^[[B" down-line-or-beginning-search # --- Tab completion --- -# Extra completions from zsh-completions -FPATH=$(brew --prefix)/share/zsh-completions:$FPATH +# Homebrew zsh-completions (macOS) +[[ -d "$(brew --prefix 2>/dev/null)/share/zsh-completions" ]] && FPATH="$(brew --prefix)/share/zsh-completions:$FPATH" +# Git-cloned zsh-completions (Linux) +[[ -d "$HOME/.zsh/zsh-completions/src" ]] && fpath=($HOME/.zsh/zsh-completions/src $fpath) autoload -Uz compinit && compinit zstyle ':completion:*' menu select zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' @@ -204,15 +273,24 @@ zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" # --- Plugins --- # Fish-like autosuggestions (grey ghost text, → to accept) -source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh +for _f in {$(brew --prefix 2>/dev/null),/usr}/share/zsh-autosuggestions/zsh-autosuggestions.zsh; do + [[ -f "$_f" ]] && source "$_f" && break +done ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=240' ZSH_AUTOSUGGEST_STRATEGY=(history completion) # Syntax highlighting (commands turn green/red as you type) -source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +for _f in {$(brew --prefix 2>/dev/null),/usr}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh; do + [[ -f "$_f" ]] && source "$_f" && break +done # fzf fuzzy search (Ctrl+R for history, Ctrl+T for files) -[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh +if [[ -f ~/.fzf.zsh ]]; then + source ~/.fzf.zsh +elif [[ -d /usr/share/doc/fzf/examples ]]; then + source /usr/share/doc/fzf/examples/key-bindings.zsh + source /usr/share/doc/fzf/examples/completion.zsh +fi export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border --color=fg:#f8f8f2,bg:#282a36,hl:#bd93f9,fg+:#f8f8f2,bg+:#44475a,hl+:#bd93f9,info:#ffb86c,prompt:#50fa7b,pointer:#ff79c6,marker:#ff79c6' # Use ripgrep/fd with fzf if available @@ -226,7 +304,7 @@ command -v zoxide &>/dev/null && eval "$(zoxide init zsh)" eval "$(starship init zsh)" # --- True color support (macOS 26+) --- -if [[ "$(sw_vers -productVersion 2>/dev/null)" == 26.* ]]; then +if [[ -z "$COLORTERM" ]] && [[ "$(sw_vers -productVersion 2>/dev/null)" == 26.* ]]; then export COLORTERM=truecolor fi @@ -241,6 +319,7 @@ alias ...='cd ../..' alias gs='git status' alias gl='git log --oneline -20' alias gd='git diff' +command -v fdfind &>/dev/null && ! command -v fd &>/dev/null && alias fd='fdfind' # --- Word boundaries (stop at /, ., - like macOS) --- WORDCHARS='' @@ -259,7 +338,7 @@ bindkey '\e^M' self-insert # Option+Enter — insert newline (mul ZSHRC # Replace tmux toggle placeholder with actual value -sed -i '' "s/__TMUX_TOGGLE__/$TMUX_TOGGLE/" ~/.zshrc +sed_inplace "s/__TMUX_TOGGLE__/$TMUX_TOGGLE/" ~/.zshrc # --- 10. Starship config --- mkdir -p ~/.config @@ -303,32 +382,49 @@ echo "" read -p "🔤 Install Monaspace Nerd Font? (icons for Starship + dev tools) [y/N] " -n 1 -r INSTALL_FONT < /dev/tty echo "" if [[ $INSTALL_FONT =~ ^[Yy]$ ]]; then - brew install --cask font-monaspice-nerd-font + if $IS_MACOS; then + brew install --cask font-monaspice-nerd-font + else + FONT_DIR="$HOME/.local/share/fonts" + mkdir -p "$FONT_DIR" + FONT_URL="https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Monaspace.tar.xz" + echo " Downloading Monaspace Nerd Font..." + curl -fsSL "$FONT_URL" -o /tmp/Monaspace.tar.xz + tar -xf /tmp/Monaspace.tar.xz -C "$FONT_DIR" + rm -f /tmp/Monaspace.tar.xz + fc-cache -fv "$FONT_DIR" >/dev/null 2>&1 + fi echo " ✅ Monaspace Nerd Font installed" fi -# --- 12. Terminal.app profile (optional) --- -echo "" -read -p "🎨 Import Dmythro Terminal.app profile? (dark theme, MonaspiceNe NFM 14pt) [y/N] " -n 1 -r INSTALL_PROFILE < /dev/tty -echo "" -if [[ $INSTALL_PROFILE =~ ^[Yy]$ ]]; then - curl -sL "${REPO_RAW}/Dmythro.terminal" -o /tmp/Dmythro.terminal - open /tmp/Dmythro.terminal - sleep 1 - defaults write com.apple.Terminal "Default Window Settings" -string "Dmythro" - defaults write com.apple.Terminal "Startup Window Settings" -string "Dmythro" - echo " ✅ Profile imported and set as default" +# --- 12. Terminal.app profile (macOS only) --- +if $IS_MACOS; then + echo "" + read -p "🎨 Import Dmythro Terminal.app profile? (dark theme, MonaspiceNe NFM 14pt) [y/N] " -n 1 -r INSTALL_PROFILE < /dev/tty + echo "" + if [[ $INSTALL_PROFILE =~ ^[Yy]$ ]]; then + curl -sL "${REPO_RAW}/Dmythro.terminal" -o /tmp/Dmythro.terminal + open /tmp/Dmythro.terminal + sleep 1 + defaults write com.apple.Terminal "Default Window Settings" -string "Dmythro" + defaults write com.apple.Terminal "Startup Window Settings" -string "Dmythro" + echo " ✅ Profile imported and set as default" + fi fi # --- 13. Done --- echo "" -if [[ $INSTALL_PROFILE =~ ^[Yy]$ ]]; then +if $IS_MACOS && [[ $INSTALL_PROFILE =~ ^[Yy]$ ]]; then echo "⚠️ Manual step for Option+Arrow word jumping:" echo " Terminal.app → Settings → Profiles → Dmythro → Keyboard" echo " ✅ Check 'Use Option as Meta key'" echo "" fi -echo "✅ Done! Quit Terminal.app (Cmd+Q) and reopen to see all changes." +if $IS_MACOS; then + echo "✅ Done! Quit Terminal.app (Cmd+Q) and reopen to see all changes." +else + echo "✅ Done! Close and reopen your terminal to see all changes." +fi echo "" echo "📋 What you got:" echo " • Prefix history search — type 'git' then ↑ to search" @@ -340,15 +436,17 @@ echo " • Option+← / Option+→ for word jumping" echo " • Option+Delete stops at /, ., - (macOS-like word boundaries)" echo " • Option+Enter for multiline commands (useful with code agents)" echo " • Tab/window title shows current dir and command" -if [[ $INSTALL_PROFILE =~ ^[Yy]$ ]]; then +if $IS_MACOS && [[ $INSTALL_PROFILE =~ ^[Yy]$ ]]; then echo " • Dark theme with MonaspiceNe NFM 14pt" fi if [[ $INSTALL_FONT =~ ^[Yy]$ ]]; then -if [[ $INSTALL_PROFILE =~ ^[Yy]$ ]]; then +if $IS_MACOS && [[ $INSTALL_PROFILE =~ ^[Yy]$ ]]; then echo " • Monaspace Nerd Font installed (already set in profile)" -else +elif $IS_MACOS; then echo " • Monaspace Nerd Font installed — set it in Terminal.app:" echo " Settings > Profiles > Font > Change > MonaspiceNe Nerd Font" +else +echo " • Monaspace Nerd Font installed to ~/.local/share/fonts" fi fi if [[ $INSTALL_TMUX =~ ^[Yy]$ ]]; then @@ -363,8 +461,10 @@ echo " • Prefix + HJKL resize panes (arrow keys unbound — no zsh conflicts echo " • Prefix + z zoom/unzoom pane" echo " • Prefix + x close pane" echo " • Prefix + c new window • Prefix + n/p next/prev window" +if $IS_MACOS; then echo " • Note: Cmd+D is Terminal.app's own split (horizontal only, shared session) — use tmux instead" fi +fi if [[ $INSTALL_DEV =~ ^[Yy]$ ]]; then echo " • Dev tools: gh, bun, ripgrep (rg), fd, zoxide (z), delta" echo " • fzf uses rg/fd for faster file/dir search" @@ -373,11 +473,28 @@ echo " • git diff/log now uses delta with syntax highlighting" fi echo "" echo " 🤖 AI coding agents — install any when ready:" +if $IS_MACOS; then echo " brew install opencode # open-source terminal agent" echo " brew install --cask claude-code # Anthropic" echo " brew install --cask codex # OpenAI (open source)" echo " brew install gemini-cli # Google (open source)" echo " brew install aider # multi-model pair programming" +else +echo " npm install -g @anthropic-ai/claude-code # Anthropic" +echo " npm install -g @openai/codex # OpenAI (open source)" +echo " pip install aider-chat # multi-model pair programming" +echo " # OpenCode: see https://opencode.ai" +echo " # Gemini CLI: see https://github.com/google-gemini/gemini-cli" +fi +echo "" +if $IS_LINUX && [[ "$SHELL" != *"/zsh" ]]; then +echo "⚠️ Your default shell is not zsh. Run this to switch:" +echo " chsh -s \$(which zsh)" echo "" +fi +if $IS_MACOS; then echo "💡 To use on another Mac, run:" +else +echo "💡 To use on another machine, run:" +fi echo " curl -sL https://raw.githubusercontent.com/dmythro/terminal-setup/main/setup-terminal.sh | bash"