diff --git a/tabs/applications-setup/alacritty-setup.sh b/tabs/applications-setup/alacritty-setup.sh index 92e49d337..f97346bfc 100755 --- a/tabs/applications-setup/alacritty-setup.sh +++ b/tabs/applications-setup/alacritty-setup.sh @@ -24,11 +24,21 @@ setupAlacrittyConfig() { cp -r "${HOME}/.config/alacritty" "${HOME}/.config/alacritty-bak" fi mkdir -p "${HOME}/.config/alacritty/" - curl -sSLo "${HOME}/.config/alacritty/alacritty.toml" "https://github.com/ChrisTitusTech/dwm-titus/raw/main/config/alacritty/alacritty.toml" - curl -sSLo "${HOME}/.config/alacritty/nordic.toml" "https://github.com/ChrisTitusTech/dwm-titus/raw/main/config/alacritty/nordic.toml" + curl -sSLo "${HOME}/.config/alacritty/alacritty.yml" "https://github.com/ChrisTitusTech/dwm-titus/raw/main/config/alacritty/alacritty.yml" + curl -sSLo "${HOME}/.config/alacritty/nordic.yml" "https://github.com/ChrisTitusTech/dwm-titus/raw/main/config/alacritty/nordic.yml" + + alacritty_version=$(alacritty --version | awk '{print $2}') + if [ "$(printf '%s\n' "$alacritty_version" "0.13.0" | sort -V | head -n1)" = "0.13.0" ]; then # Check if alacritty is < 0.13.0 https://alacritty.org/changelog_0_13_0.html#Changed + echo "Alacritty version is gearter or equal to 0.13.0, migrating config files..." + if alacritty migrate; then + command rm -f "${HOME}/.config/alacritty/*.yml" # Using 'command' to avoid alias + else + echo "Failed to migrate alacritty config files." + fi + fi } checkEnv checkEscalationTool setupAlacritty -setupAlacrittyConfig \ No newline at end of file +setupAlacrittyConfig