From 086369252fb08fd2c743c96981b6ba0c9f121e39 Mon Sep 17 00:00:00 2001 From: jc <46619361+juancwu@users.noreply.github.com> Date: Sun, 17 Nov 2024 13:25:01 -0500 Subject: [PATCH] (bash) update terminal theme logic copy theme file instead of creating a symlink forces alacritty to reload in some linux distros such as ubuntu and fedora for some reason removing/creating a new symlink does not trigger the live reload of alacritty --- bash/.bashrc.arch | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/bash/.bashrc.arch b/bash/.bashrc.arch index a408d6b..387486a 100644 --- a/bash/.bashrc.arch +++ b/bash/.bashrc.arch @@ -295,25 +295,26 @@ export TERM_COLOR_MODE # set the terminal color theme USE_TERM=alacritty -if [ $TERM_COLOR_MODE == "light" ]; then - if [ $USE_TERM == "kitty" ]; then - kitten @ set-colors --all "$HOME/.config/kitty/light.conf" - fi - if [ $USE_TERM == "alacritty" ]; then - theme_link="$HOME/.config/alacritty/theme.toml" - rm -rf "$theme_link" - ln -s "$HOME/ghq/alacritty/alacritty-theme/themes/catppuccin_latte.toml" "$theme_link" - fi -else - if [ $USE_TERM == "kitty" ]; then - kitten @ set-colors --all "$HOME/.config/kitty/dark.conf" - fi - if [ $USE_TERM == "alacritty" ]; then - theme_link="$HOME/.config/alacritty/theme.toml" - rm -r "$theme_link" - ln -s "$HOME/ghq/alacritty/alacritty-theme/themes/catppuccin_mocha.toml" "$theme_link" - fi +theme_link="$HOME/.config/alacritty/theme.toml" +use_theme="$HOME/ghq/alacritty/alacritty-theme/themes/catppuccin_latte.toml" +if [ $TERM_COLOR_MODE == "dark" ]; then + # if [ $USE_TERM == "kitty" ]; then + # kitten @ set-colors --all "$HOME/.config/kitty/light.conf" + # fi + # if [ $USE_TERM == "alacritty" ]; then + # cp "$HOME/ghq/alacritty/alacritty-theme/themes/catppuccin_latte.toml" "$theme_link" + # fi + use_theme="$HOME/ghq/alacritty/alacritty-theme/themes/catppuccin_mocha.toml" +# else +# if [ $USE_TERM == "kitty" ]; then +# kitten @ set-colors --all "$HOME/.config/kitty/dark.conf" +# fi +# if [ $USE_TERM == "alacritty" ]; then +# cp "$HOME/ghq/alacritty/alacritty-theme/themes/catppuccin_mocha.toml" "$theme_link" +# fi fi +rm -f "$theme_link" +cp "$use_theme" "$theme_link" # setup kitty, it will export TERM_COLOR_MODE (can be light or dark) # source ~/.config/kitty/setup.sh