From 15eaaf8b17e32fa3280a05fde00be3c770d6d942 Mon Sep 17 00:00:00 2001 From: afranco Date: Mon, 16 Jun 2025 09:24:14 +0100 Subject: [PATCH] chore(scripts): cleanup change-theme.sh --- .local/bin/change-theme.sh | 109 ++++++------------------------------- 1 file changed, 18 insertions(+), 91 deletions(-) diff --git a/.local/bin/change-theme.sh b/.local/bin/change-theme.sh index cb3c8bd..edb6354 100755 --- a/.local/bin/change-theme.sh +++ b/.local/bin/change-theme.sh @@ -6,56 +6,32 @@ set +e # Declare theme configurations typeset -A themes themes[catppuccin-latte]=\ -'alacritty_theme_name=catppuccin_latte - ghostty_theme_name=catppuccin-latte - nvim_color_scheme=catppuccin-latte - background_color=#eff1f5 - tmux_bar_unfocused_fg=#4c4f69 - tmux_bar_focused_bg=#4c4f69 - tmux_bar_focused_fg=#eff1f5 - kitty_theme="Catppuccin-Latte"' +'ghostty_theme_name=catppuccin-latte + nvim_color_scheme=catppuccin-latte' themes[catppuccin-frappe]=\ -'alacritty_theme_name=catppuccin_frappe - ghostty_theme_name=catppuccin-frappe - nvim_color_scheme=catppuccin-frappe - background_color=#303446 - tmux_bar_unfocused_fg=#c6d0f5 - tmux_bar_focused_bg=#c6d0f5 - tmux_bar_focused_fg=#303446 - kitty_theme="Catppuccin-Frappe"' + 'ghostty_theme_name=catppuccin-frappe + nvim_color_scheme=catppuccin-frappe' themes[gruvbox-original-hard-dark]=\ -'alacritty_theme_name=gruvbox_dark - ghostty_theme_name=GruvboxDarkHard +'ghostty_theme_name=GruvboxDarkHard nvim_color_scheme=gruvbox-material - background_color=#1d2021 - tmux_bar_unfocused_fg=#ebdbb2 - tmux_bar_focused_bg=#ebdbb2 - tmux_bar_focused_fg=#1d2021 additional_nvim_commands="\ vim.g.gruvbox_material_better_performance=1 vim.g.gruvbox_material_background=\"hard\" vim.g.gruvbox_material_foreground=\"original\" vim.g.gruvbox_material_transparent_background=2 -vim.opt.background=\"dark\"" - kitty_theme="Gruvbox Dark Hard"' +vim.opt.background=\"dark\""' themes[gruvbox-original-medium-light]=\ -'alacritty_theme_name=gruvbox_light - ghostty_theme_name=GruvboxLight +'ghostty_theme_name=GruvboxLight nvim_color_scheme=gruvbox-material - background_color=#fbf1c7 - tmux_bar_unfocused_fg=#3c3836 - tmux_bar_focused_bg=#3c3836 - tmux_bar_focused_fg=#fbf1c7 additional_nvim_commands="\ vim.g.gruvbox_material_better_performance=1 vim.g.gruvbox_material_background=\"medium\" vim.g.gruvbox_material_foreground=\"original\" vim.g.gruvbox_material_transparent_background=2 -vim.opt.background=\"light\"" - kitty_theme="Gruvbox Light Medium"' +vim.opt.background=\"light\""' themes[gruvbox-material-hard-dark]=\ 'alacritty_theme_name=gruvbox_dark @@ -74,91 +50,57 @@ vim.opt.background=\"dark\"" kitty_theme="Gruvbox Material Dark Hard"' themes[gruvbox-material-medium-dark]=\ -'alacritty_theme_name=gruvbox_dark - ghostty_theme_name=gruvbox-material-medium-dark +'ghostty_theme_name=gruvbox-material-medium-dark nvim_color_scheme=gruvbox-material - background_color=#282828 - tmux_bar_unfocused_fg=#d4be98 - tmux_bar_focused_bg=#d4be98 - tmux_bar_focused_fg=#282828 additional_nvim_commands="\ vim.g.gruvbox_material_better_performance=1 vim.g.gruvbox_material_background=\"medium\" vim.g.gruvbox_material_foreground=\"material\" vim.g.gruvbox_material_transparent_background=2 -vim.opt.background=\"dark\"" - kitty_theme="Gruvbox Material Dark Medium"' +vim.opt.background=\"dark\""' themes[gruvbox-material-soft-dark]=\ -'alacritty_theme_name=gruvbox_dark - ghostty_theme_name=gruvbox-material-soft-dark + 'ghostty_theme_name=gruvbox-material-soft-dark nvim_color_scheme=gruvbox-material - background_color=#32302f - tmux_bar_unfocused_fg=#d4be98 - tmux_bar_focused_bg=#d4be98 - tmux_bar_focused_fg=#32302f additional_nvim_commands="\ vim.g.gruvbox_material_better_performance=1 vim.g.gruvbox_material_background=\"soft\" vim.g.gruvbox_material_foreground=\"material\" vim.g.gruvbox_material_transparent_background=2 -vim.opt.background=\"dark\"" - kitty_theme="Gruvbox Material Dark Soft"' +vim.opt.background=\"dark\""' themes[gruvbox-material-hard-light]=\ -'alacritty_theme_name=gruvbox_light - ghostty_theme_name=gruvbox-material-hard-light + 'ghostty_theme_name=gruvbox-material-hard-light nvim_color_scheme=gruvbox-material - background_color=#f9f5d7 - tmux_bar_unfocused_fg=#654735 - tmux_bar_focused_bg=#654735 - tmux_bar_focused_fg=#f9f5d7 additional_nvim_commands="\ vim.g.gruvbox_material_better_performance=1 vim.g.gruvbox_material_background=\"hard\" vim.g.gruvbox_material_foreground=\"material\" vim.g.gruvbox_material_transparent_background=2 -vim.opt.background=\"light\"" - kitty_theme="Gruvbox Material Light Hard"' +vim.opt.background=\"light\""' themes[gruvbox-material-medium-light]=\ -'alacritty_theme_name=gruvbox_light - ghostty_theme_name=gruvbox-material-medium-light - background_color=#fbf1c7 - tmux_bar_unfocused_fg=#654735 - tmux_bar_focused_bg=#654735 - tmux_bar_focused_fg=#fbf1c7 + 'ghostty_theme_name=gruvbox-material-medium-light nvim_color_scheme=gruvbox-material additional_nvim_commands="\ vim.g.gruvbox_material_better_performance=1 vim.g.gruvbox_material_background=\"medium\" vim.g.gruvbox_material_foreground=\"material\" vim.g.gruvbox_material_transparent_background=2 -vim.opt.background=\"light\"" - kitty_theme="Gruvbox Material Light Medium"' +vim.opt.background=\"light\""' themes[gruvbox-material-soft-light]=\ -'alacritty_theme_name=gruvbox_light - ghostty_theme_name=gruvbox-material-soft-light - background_color=#f2e5bc - tmux_bar_unfocused_fg=#654735 - tmux_bar_focused_bg=#654735 - tmux_bar_focused_fg=#f2e5bc + 'ghostty_theme_name=gruvbox-material-soft-light nvim_color_scheme=gruvbox-material additional_nvim_commands="\ vim.g.gruvbox_material_better_performance=1 vim.g.gruvbox_material_background=\"soft\" vim.g.gruvbox_material_foreground=\"material\" vim.g.gruvbox_material_transparent_background=2 -vim.opt.background=\"light\"" - kitty_theme="Gruvbox Material Light Soft"' +vim.opt.background=\"light\""' themes[everforest-hard-dark]=\ 'ghostty_theme_name=everforest-hard-dark - background_color=#272e33 - tmux_bar_unfocused_fg=#3c4841 - tmux_bar_focused_bg=#3c4841 - tmux_bar_focused_fg=#d3c6aa nvim_color_scheme=everforest additional_nvim_commands="\ vim.g.everforest_better_performance=1 @@ -168,10 +110,6 @@ vim.opt.background=\"dark\""' themes[everforest-medium-dark]=\ 'ghostty_theme_name=everforest-medium-dark - background_color=#2d353b - tmux_bar_unfocused_fg=#425047 - tmux_bar_focused_bg=#425047 - tmux_bar_focused_fg=#d3c6aa nvim_color_scheme=everforest additional_nvim_commands="\ vim.g.everforest_better_performance=1 @@ -181,10 +119,6 @@ vim.opt.background=\"dark\""' themes[everforest-soft-dark]=\ 'ghostty_theme_name=everforest-soft-dark - background_color=#333c43 - tmux_bar_unfocused_fg=#48584e - tmux_bar_focused_bg=#48584e - tmux_bar_focused_fg=#d3c6aa nvim_color_scheme=everforest additional_nvim_commands="\ vim.g.everforest_better_performance=1 @@ -205,14 +139,7 @@ reload_neovim() { # Change common settings change_theme() { - [[ -n "$alacritty_theme_name" ]] && sed -i '' -e "s|import = \[\"~/.config/alacritty/themes/.*\"\]|import = [\"~/.config/alacritty/themes/${alacritty_theme_name}.toml\"]|g" ~/.config/alacritty/alacritty.toml [[ -n "$ghostty_theme_name" ]] && sed -i '' -E "s/theme =.*$/theme = $ghostty_theme_name/" ~/.config/ghostty/config - [[ -n "$kitty_theme" ]] && kitten themes --reload-in=all "$kitty_theme" - sed -i '' -E "s/set -g status-bg .*$/set -g status-bg \"$background_color\"/" ~/.config/tmux/tmux.conf - sed -i '' -E "s/set -g @unfocused-fg .*$/set -g @unfocused-fg \"$tmux_bar_unfocused_fg\"/" ~/.config/tmux/tmux.conf - sed -i '' -E "s/set -g @focused-bg .*$/set -g @focused-bg \"$tmux_bar_focused_bg\"/" ~/.config/tmux/tmux.conf - sed -i '' -E "s/set -g @focused-fg .*$/set -g @focused-fg \"$tmux_bar_focused_fg\"/" ~/.config/tmux/tmux.conf - tmux source-file ~/.config/tmux/tmux.conf reload_neovim "$nvim_color_scheme" "$additional_nvim_commands" }