#!/usr/bin/env bash # Install Seth's kitty theme + Nerd Font on any Linux machine set -euo pipefail TARGET_HOME="${1:-$HOME}" SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" KITTY_DIR="$TARGET_HOME/.config/kitty" echo "=== Seth Linux Theme — Kitty Install ===" echo "Target: $TARGET_HOME" # ── Nerd Font ── if fc-list | grep -qi "JetBrainsMono.*Nerd" 2>/dev/null; then echo "[ok] JetBrainsMono Nerd Font already installed." else echo "[install] Downloading JetBrainsMono Nerd Font..." TMP="$(mktemp -d)" curl -fsSL -o "$TMP/JetBrainsMono.zip" \ https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.zip sudo mkdir -p /usr/local/share/fonts/NerdFonts sudo unzip -oq "$TMP/JetBrainsMono.zip" -d /usr/local/share/fonts/NerdFonts/ sudo fc-cache -f rm -rf "$TMP" echo "[ok] Nerd Font installed." fi # ── Kitty config dir ── mkdir -p "$KITTY_DIR" # Create default kitty.conf if none exists if [ ! -f "$KITTY_DIR/kitty.conf" ]; then echo "# kitty.conf" > "$KITTY_DIR/kitty.conf" echo "[ok] Created default kitty.conf." fi # ── Copy theme files ── cp "$SCRIPT_DIR/kitty/kitty-theme.conf" "$KITTY_DIR/" cp "$SCRIPT_DIR/kitty/tab_bar.py" "$KITTY_DIR/" cp "$SCRIPT_DIR/kitty/tab-bar-hide.conf" "$KITTY_DIR/" cp "$SCRIPT_DIR/kitty/tab-bar-show.conf" "$KITTY_DIR/" echo "[ok] Theme files copied." # ── Set font in kitty.conf ── if grep -q "^font_family" "$KITTY_DIR/kitty.conf"; then sed -i 's/^font_family.*/font_family JetBrainsMono Nerd Font/' "$KITTY_DIR/kitty.conf" elif grep -q "^# font_family" "$KITTY_DIR/kitty.conf"; then sed -i 's/^# font_family.*/font_family JetBrainsMono Nerd Font/' "$KITTY_DIR/kitty.conf" else echo "" >> "$KITTY_DIR/kitty.conf" echo "font_family JetBrainsMono Nerd Font" >> "$KITTY_DIR/kitty.conf" fi echo "[ok] Font set to JetBrainsMono Nerd Font." # ── Include theme conf ── if ! grep -q "include kitty-theme.conf" "$KITTY_DIR/kitty.conf" 2>/dev/null; then echo "" >> "$KITTY_DIR/kitty.conf" echo "include kitty-theme.conf" >> "$KITTY_DIR/kitty.conf" fi echo "[ok] kitty-theme.conf included." echo "" echo "Done. Restart kitty to see changes." echo " F12 = hide tab bar" echo " Shift+F12 = show tab bar"