mirror of
https://github.com/avinal/dotfiles.git
synced 2026-07-03 23:20:07 +05:30
feat: major update to all configs
- move older config to archive Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
This commit is contained in:
Executable
+301
@@ -0,0 +1,301 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
DOTFILES_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 <palette-name>"
|
||||
echo ""
|
||||
echo "Available palettes:"
|
||||
for f in "$SCRIPT_DIR/palettes/"*.sh; do
|
||||
basename "$f" .sh
|
||||
done
|
||||
exit 1
|
||||
}
|
||||
|
||||
[[ $# -lt 1 ]] && usage
|
||||
|
||||
PALETTE="$SCRIPT_DIR/palettes/$1.sh"
|
||||
[[ ! -f "$PALETTE" ]] && echo "Palette '$1' not found." && usage
|
||||
|
||||
source "$PALETTE"
|
||||
|
||||
strip() { echo "${1#\#}"; }
|
||||
|
||||
# RGB decimal from hex (for zellij)
|
||||
rgb() {
|
||||
local hex="${1#\#}"
|
||||
printf "%d %d %d" "0x${hex:0:2}" "0x${hex:2:2}" "0x${hex:4:2}"
|
||||
}
|
||||
|
||||
echo "Applying theme: $THEME_NAME"
|
||||
echo "================================"
|
||||
|
||||
# --- Ghostty theme ---
|
||||
GHOSTTY_THEME="$DOTFILES_DIR/.config/ghostty/themes/$THEME_NAME"
|
||||
cat > "$GHOSTTY_THEME" << EOF
|
||||
palette = 0=$BLACK
|
||||
palette = 1=$RED
|
||||
palette = 2=$GREEN
|
||||
palette = 3=$YELLOW
|
||||
palette = 4=$BLUE
|
||||
palette = 5=$MAGENTA
|
||||
palette = 6=$CYAN
|
||||
palette = 7=$WHITE
|
||||
|
||||
palette = 8=$BRIGHT_BLACK
|
||||
palette = 9=$BRIGHT_RED
|
||||
palette = 10=$BRIGHT_GREEN
|
||||
palette = 11=$BRIGHT_YELLOW
|
||||
palette = 12=$BRIGHT_BLUE
|
||||
palette = 13=$BRIGHT_MAGENTA
|
||||
palette = 14=$BRIGHT_CYAN
|
||||
palette = 15=$BRIGHT_WHITE
|
||||
|
||||
background = $BG
|
||||
foreground = $FG
|
||||
cursor-color = $CURSOR
|
||||
cursor-text = $BG
|
||||
selection-background = $SELECTION_BG
|
||||
selection-foreground = $SELECTION_FG
|
||||
EOF
|
||||
|
||||
# Update ghostty config to reference this theme
|
||||
sed -i "s/^theme = .*/theme = \"$THEME_NAME\"/" "$DOTFILES_DIR/.config/ghostty/config"
|
||||
echo "[ok] Ghostty theme: $GHOSTTY_THEME"
|
||||
|
||||
# --- Helix ---
|
||||
sed -i "s/^theme = .*/theme = \"$HELIX_THEME\"/" "$DOTFILES_DIR/.config/helix/config.toml"
|
||||
echo "[ok] Helix theme: $HELIX_THEME"
|
||||
|
||||
# --- Alacritty ---
|
||||
ALACRITTY="$DOTFILES_DIR/.config/alacritty/alacritty.toml"
|
||||
if [[ -f "$ALACRITTY" ]]; then
|
||||
cat > "$ALACRITTY" << EOF
|
||||
[window]
|
||||
padding = { x = 7, y = 5 }
|
||||
dynamic_padding = true
|
||||
dynamic_title = false
|
||||
|
||||
[font]
|
||||
normal = { family = "Iosevka Term", style = "Regular" }
|
||||
bold = { family = "Iosevka Term", style = "Bold" }
|
||||
italic = { family = "Iosevka Term", style = "Italic" }
|
||||
bold_italic = { family = "Iosevka Term", style = "Bold Italic" }
|
||||
size = 14
|
||||
|
||||
[colors.primary]
|
||||
background = "$BG"
|
||||
foreground = "$FG"
|
||||
|
||||
[colors.cursor]
|
||||
text = "$BG"
|
||||
cursor = "$CURSOR"
|
||||
|
||||
[colors.selection]
|
||||
text = "$SELECTION_FG"
|
||||
background = "$SELECTION_BG"
|
||||
|
||||
[colors.normal]
|
||||
black = "$BLACK"
|
||||
red = "$RED"
|
||||
green = "$GREEN"
|
||||
yellow = "$YELLOW"
|
||||
blue = "$BLUE"
|
||||
magenta = "$MAGENTA"
|
||||
cyan = "$CYAN"
|
||||
white = "$WHITE"
|
||||
|
||||
[colors.bright]
|
||||
black = "$BRIGHT_BLACK"
|
||||
red = "$BRIGHT_RED"
|
||||
green = "$BRIGHT_GREEN"
|
||||
yellow = "$BRIGHT_YELLOW"
|
||||
blue = "$BRIGHT_BLUE"
|
||||
magenta = "$BRIGHT_MAGENTA"
|
||||
cyan = "$BRIGHT_CYAN"
|
||||
white = "$BRIGHT_WHITE"
|
||||
|
||||
[cursor]
|
||||
style = { shape = "Underline", blinking = "On" }
|
||||
|
||||
[selection]
|
||||
save_to_clipboard = true
|
||||
EOF
|
||||
echo "[ok] Alacritty colors updated"
|
||||
fi
|
||||
|
||||
# --- Lazygit ---
|
||||
LAZYGIT="$DOTFILES_DIR/.config/lazygit/config.yml"
|
||||
if [[ -f "$LAZYGIT" ]]; then
|
||||
python3 -c "
|
||||
import sys, re
|
||||
|
||||
config = open('$LAZYGIT').read()
|
||||
|
||||
new_theme = ''' theme:
|
||||
activeBorderColor:
|
||||
- \"$ACCENT\"
|
||||
- bold
|
||||
inactiveBorderColor:
|
||||
- \"$MUTED\"
|
||||
selectedLineBgColor:
|
||||
- \"$SURFACE\"
|
||||
optionsTextColor:
|
||||
- \"$CYAN\"
|
||||
unstagedChangesColor:
|
||||
- \"$RED\"
|
||||
defaultFgColor:
|
||||
- \"$FG\"'''
|
||||
|
||||
config = re.sub(
|
||||
r' theme:.*?(?=\n\w|\ngit:|\ncustomCommands:|\nos:)',
|
||||
new_theme + '\n',
|
||||
config,
|
||||
flags=re.DOTALL
|
||||
)
|
||||
open('$LAZYGIT', 'w').write(config)
|
||||
"
|
||||
echo "[ok] Lazygit theme updated"
|
||||
fi
|
||||
|
||||
# --- Zellij ---
|
||||
ZELLIJ="$DOTFILES_DIR/.config/zellij/config.kdl"
|
||||
if [[ -f "$ZELLIJ" ]]; then
|
||||
python3 -c "
|
||||
import re
|
||||
|
||||
config = open('$ZELLIJ').read()
|
||||
|
||||
new_theme = '''themes {
|
||||
$THEME_NAME {
|
||||
text_unselected {
|
||||
base $(rgb "$FG")
|
||||
background $(rgb "$SURFACE")
|
||||
emphasis_0 $(rgb "$RED")
|
||||
emphasis_1 $(rgb "$CYAN")
|
||||
emphasis_2 $(rgb "$GREEN")
|
||||
emphasis_3 $(rgb "$MAGENTA")
|
||||
}
|
||||
text_selected {
|
||||
base $(rgb "$BRIGHT_WHITE")
|
||||
background $(rgb "$SELECTION_BG")
|
||||
emphasis_0 $(rgb "$RED")
|
||||
emphasis_1 $(rgb "$CYAN")
|
||||
emphasis_2 $(rgb "$GREEN")
|
||||
emphasis_3 $(rgb "$MAGENTA")
|
||||
}
|
||||
ribbon_selected {
|
||||
base $(rgb "$BG")
|
||||
background $(rgb "$GREEN")
|
||||
emphasis_0 $(rgb "$RED")
|
||||
emphasis_1 $(rgb "$YELLOW")
|
||||
emphasis_2 $(rgb "$MAGENTA")
|
||||
emphasis_3 $(rgb "$BLUE")
|
||||
}
|
||||
ribbon_unselected {
|
||||
base $(rgb "$BG")
|
||||
background $(rgb "$WHITE")
|
||||
emphasis_0 $(rgb "$RED")
|
||||
emphasis_1 $(rgb "$FG")
|
||||
emphasis_2 $(rgb "$BLUE")
|
||||
emphasis_3 $(rgb "$MAGENTA")
|
||||
}
|
||||
table_title {
|
||||
base $(rgb "$GREEN")
|
||||
background 0
|
||||
emphasis_0 $(rgb "$RED")
|
||||
emphasis_1 $(rgb "$CYAN")
|
||||
emphasis_2 $(rgb "$GREEN")
|
||||
emphasis_3 $(rgb "$MAGENTA")
|
||||
}
|
||||
table_cell_selected {
|
||||
base $(rgb "$BRIGHT_WHITE")
|
||||
background $(rgb "$SELECTION_BG")
|
||||
emphasis_0 $(rgb "$RED")
|
||||
emphasis_1 $(rgb "$CYAN")
|
||||
emphasis_2 $(rgb "$GREEN")
|
||||
emphasis_3 $(rgb "$MAGENTA")
|
||||
}
|
||||
table_cell_unselected {
|
||||
base $(rgb "$FG")
|
||||
background $(rgb "$SURFACE")
|
||||
emphasis_0 $(rgb "$RED")
|
||||
emphasis_1 $(rgb "$CYAN")
|
||||
emphasis_2 $(rgb "$GREEN")
|
||||
emphasis_3 $(rgb "$MAGENTA")
|
||||
}
|
||||
list_selected {
|
||||
base $(rgb "$BRIGHT_WHITE")
|
||||
background $(rgb "$SELECTION_BG")
|
||||
emphasis_0 $(rgb "$RED")
|
||||
emphasis_1 $(rgb "$CYAN")
|
||||
emphasis_2 $(rgb "$GREEN")
|
||||
emphasis_3 $(rgb "$MAGENTA")
|
||||
}
|
||||
list_unselected {
|
||||
base $(rgb "$FG")
|
||||
background $(rgb "$SURFACE")
|
||||
emphasis_0 $(rgb "$RED")
|
||||
emphasis_1 $(rgb "$CYAN")
|
||||
emphasis_2 $(rgb "$GREEN")
|
||||
emphasis_3 $(rgb "$MAGENTA")
|
||||
}
|
||||
frame_selected {
|
||||
base $(rgb "$GREEN")
|
||||
background 0
|
||||
emphasis_0 $(rgb "$RED")
|
||||
emphasis_1 $(rgb "$CYAN")
|
||||
emphasis_2 $(rgb "$MAGENTA")
|
||||
emphasis_3 0
|
||||
}
|
||||
frame_highlight {
|
||||
base $(rgb "$YELLOW")
|
||||
background 0
|
||||
emphasis_0 $(rgb "$YELLOW")
|
||||
emphasis_1 $(rgb "$YELLOW")
|
||||
emphasis_2 $(rgb "$YELLOW")
|
||||
emphasis_3 $(rgb "$YELLOW")
|
||||
}
|
||||
exit_code_success {
|
||||
base $(rgb "$GREEN")
|
||||
background 0
|
||||
emphasis_0 $(rgb "$CYAN")
|
||||
emphasis_1 $(rgb "$SURFACE")
|
||||
emphasis_2 $(rgb "$MAGENTA")
|
||||
emphasis_3 $(rgb "$BLUE")
|
||||
}
|
||||
exit_code_error {
|
||||
base $(rgb "$RED")
|
||||
background 0
|
||||
emphasis_0 $(rgb "$YELLOW")
|
||||
emphasis_1 0
|
||||
emphasis_2 0
|
||||
emphasis_3 0
|
||||
}
|
||||
multiplayer_user_colors {
|
||||
player_1 $(rgb "$MAGENTA")
|
||||
player_2 $(rgb "$BLUE")
|
||||
player_3 0
|
||||
player_4 $(rgb "$YELLOW")
|
||||
player_5 $(rgb "$CYAN")
|
||||
player_6 0
|
||||
player_7 $(rgb "$RED")
|
||||
player_8 0
|
||||
player_9 0
|
||||
player_10 0
|
||||
}
|
||||
}
|
||||
}'''
|
||||
|
||||
config = re.sub(r'themes \{.*?\n\}', new_theme, config, flags=re.DOTALL)
|
||||
config = re.sub(r'theme \".*?\"', 'theme \"$THEME_NAME\"', config)
|
||||
open('$ZELLIJ', 'w').write(config)
|
||||
"
|
||||
echo "[ok] Zellij theme: $THEME_NAME"
|
||||
fi
|
||||
|
||||
echo "================================"
|
||||
echo "Done! Restart your tools to see changes."
|
||||
echo "Helix theme is set in config, no restart needed for new files."
|
||||
@@ -0,0 +1,50 @@
|
||||
# vim_dark_high_contrast - from Helix editor theme
|
||||
# Source: /usr/lib64/helix/runtime/themes/vim_dark_high_contrast.toml
|
||||
|
||||
THEME_NAME="vim_dark_high_contrast"
|
||||
HELIX_THEME="vim_dark_high_contrast"
|
||||
|
||||
# Base
|
||||
BG="#000000"
|
||||
FG="#c1c9d2"
|
||||
CURSOR="#c1c9d2"
|
||||
SELECTION_BG="#3e4043"
|
||||
SELECTION_FG="#ffffff"
|
||||
|
||||
# Normal colors
|
||||
BLACK="#000000"
|
||||
RED="#ed5f74"
|
||||
GREEN="#1ea672"
|
||||
YELLOW="#d97917"
|
||||
BLUE="#688ef1"
|
||||
MAGENTA="#c96ed0"
|
||||
CYAN="#3a97d4"
|
||||
WHITE="#e3e8ee"
|
||||
|
||||
# Bright colors
|
||||
BRIGHT_BLACK="#697386"
|
||||
BRIGHT_RED="#fbb5b2"
|
||||
BRIGHT_GREEN="#85d996"
|
||||
BRIGHT_YELLOW="#efc078"
|
||||
BRIGHT_BLUE="#9fcdff"
|
||||
BRIGHT_MAGENTA="#f0b4e4"
|
||||
BRIGHT_CYAN="#7fd3ed"
|
||||
BRIGHT_WHITE="#ffffff"
|
||||
|
||||
# Dark/muted variants (for backgrounds, subtle highlights)
|
||||
DARK_RED="#742833"
|
||||
DARK_GREEN="#00643c"
|
||||
DARK_YELLOW="#6e3500"
|
||||
DARK_BLUE="#2c4074"
|
||||
DARK_MAGENTA="#602864"
|
||||
DARK_CYAN="#144c71"
|
||||
DARK_WHITE="#3e4043"
|
||||
|
||||
# Semantic
|
||||
ACCENT="$CYAN"
|
||||
SUCCESS="$GREEN"
|
||||
WARNING="$YELLOW"
|
||||
ERROR="$RED"
|
||||
INFO="$BLUE"
|
||||
MUTED="$BRIGHT_BLACK"
|
||||
SURFACE="$DARK_WHITE"
|
||||
Reference in New Issue
Block a user