From 7c2f7807bbff6025f994b3a348ad05dcfb367023 Mon Sep 17 00:00:00 2001 From: JEEVITHA KANNAN K S Date: Tue, 24 Sep 2024 09:02:03 +0530 Subject: [PATCH] Fix config cloning --- .../applications-setup/Developer-tools/neovim-setup.sh | 8 +++++--- core/tabs/applications-setup/alacritty-setup.sh | 7 +++++-- core/tabs/applications-setup/fastfetch-setup.sh | 7 +++++-- core/tabs/applications-setup/kitty-setup.sh | 7 +++++-- core/tabs/applications-setup/rofi-setup.sh | 7 +++++-- 5 files changed, 25 insertions(+), 11 deletions(-) diff --git a/core/tabs/applications-setup/Developer-tools/neovim-setup.sh b/core/tabs/applications-setup/Developer-tools/neovim-setup.sh index 04cfdb9e6..23b82fcea 100755 --- a/core/tabs/applications-setup/Developer-tools/neovim-setup.sh +++ b/core/tabs/applications-setup/Developer-tools/neovim-setup.sh @@ -45,10 +45,12 @@ installNeovim() { backupNeovimConfig() { printf "%b\n" "${YELLOW}Backing up existing configuration files...${RC}" - if [ -d "$HOME/.config/nvim" ] && [ ! -d "$HOME/.config/nvim-backup" ]; then - cp -r "$HOME/.config/nvim" "$HOME/.config/nvim-backup" + if [ -d "$HOME/.config/nvim" ]; then + if [ -d "$HOME/.config/nvim-linutilbak" ]; then + rm -rf "$HOME/.config/nvim-linutilbak" + fi + mv "$HOME/.config/nvim" "$HOME/.config/nvim-linutilbak" fi - rm -rf "$HOME/.config/nvim" } linkNeovimConfig() { diff --git a/core/tabs/applications-setup/alacritty-setup.sh b/core/tabs/applications-setup/alacritty-setup.sh index 25558fed0..baaa2d205 100755 --- a/core/tabs/applications-setup/alacritty-setup.sh +++ b/core/tabs/applications-setup/alacritty-setup.sh @@ -20,8 +20,11 @@ installAlacritty() { setupAlacrittyConfig() { printf "%b\n" "${YELLOW}Copying alacritty config files...${RC}" - if [ -d "${HOME}/.config/alacritty" ] && [ ! -d "${HOME}/.config/alacritty-bak" ]; then - cp -r "${HOME}/.config/alacritty" "${HOME}/.config/alacritty-bak" + if [ -d "${HOME}/.config/alacritty" ]; then + if [ -d "${HOME}/.config/alacritty-linutilbak" ]; then + rm -rf "${HOME}/.config/alacritty-linutilbak" + fi + mv "${HOME}/.config/alacritty" "${HOME}/.config/alacritty-linutilbak" 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" diff --git a/core/tabs/applications-setup/fastfetch-setup.sh b/core/tabs/applications-setup/fastfetch-setup.sh index cb523441f..247314d20 100644 --- a/core/tabs/applications-setup/fastfetch-setup.sh +++ b/core/tabs/applications-setup/fastfetch-setup.sh @@ -25,8 +25,11 @@ installFastfetch() { setupFastfetchConfig() { printf "%b\n" "${YELLOW}Copying Fastfetch config files...${RC}" - if [ -d "${HOME}/.config/fastfetch" ] && [ ! -d "${HOME}/.config/fastfetch-bak" ]; then - cp -r "${HOME}/.config/fastfetch" "${HOME}/.config/fastfetch-bak" + if [ -d "${HOME}/.config/fastfetch" ]; then + if [ -d "${HOME}/.config/fastfetch-linutilbak" ]; then + rm -rf "${HOME}/.config/fastfetch-linutilbak" + fi + mv "${HOME}/.config/fastfetch" "${HOME}/.config/fastfetch-linutilbak" fi mkdir -p "${HOME}/.config/fastfetch/" curl -sSLo "${HOME}/.config/fastfetch/config.jsonc" https://raw.githubusercontent.com/ChrisTitusTech/mybash/main/config.jsonc diff --git a/core/tabs/applications-setup/kitty-setup.sh b/core/tabs/applications-setup/kitty-setup.sh index 85ef129b6..f17a21b3c 100755 --- a/core/tabs/applications-setup/kitty-setup.sh +++ b/core/tabs/applications-setup/kitty-setup.sh @@ -20,8 +20,11 @@ installKitty() { setupKittyConfig() { printf "%b\n" "${YELLOW}Copying Kitty configuration files...${RC}" - if [ -d "${HOME}/.config/kitty" ] && [ ! -d "${HOME}/.config/kitty-bak" ]; then - cp -r "${HOME}/.config/kitty" "${HOME}/.config/kitty-bak" + if [ -d "${HOME}/.config/kitty" ]; then + if [ -d "${HOME}/.config/kitty-linutilbak" ]; then + rm -rf "${HOME}/.config/kitty-linutilbak" + fi + mv "${HOME}/.config/kitty" "${HOME}/.config/kitty-linutilbak" fi mkdir -p "${HOME}/.config/kitty/" curl -sSLo "${HOME}/.config/kitty/kitty.conf" https://github.com/ChrisTitusTech/dwm-titus/raw/main/config/kitty/kitty.conf diff --git a/core/tabs/applications-setup/rofi-setup.sh b/core/tabs/applications-setup/rofi-setup.sh index 24ce1a67d..c888feb47 100755 --- a/core/tabs/applications-setup/rofi-setup.sh +++ b/core/tabs/applications-setup/rofi-setup.sh @@ -20,8 +20,11 @@ installRofi() { setupRofiConfig() { printf "%b\n" "${YELLOW}Copying Rofi configuration files...${RC}" - if [ -d "$HOME/.config/rofi" ] && [ ! -d "$HOME/.config/rofi-bak" ]; then - cp -r "$HOME/.config/rofi" "$HOME/.config/rofi-bak" + if [ -d "$HOME/.config/rofi" ]; then + if [ -d "$HOME/.config/rofi-linutilbak" ]; then + rm -rf "$HOME/.config/rofi-linutilbak" + fi + mv "$HOME/.config/rofi" "$HOME/.config/rofi-linutilbak" fi mkdir -p "$HOME/.config/rofi" curl -sSLo "$HOME/.config/rofi/powermenu.sh" https://github.com/ChrisTitusTech/dwm-titus/raw/main/config/rofi/powermenu.sh