working on copy script

This commit is contained in:
shynd 2025-02-20 21:06:17 +01:00
parent a5973792c5
commit 8519421087
1 changed files with 57 additions and 1 deletions

58
copy.sh
View File

@ -224,4 +224,60 @@ ${MAGENTA} NOTE:${RESET}
*) *)
echo "${ERROR} Please enter either 'y' or 'n'." ;; echo "${ERROR} Please enter either 'y' or 'n'." ;;
esac esac
done done
# Check if asusctl is installed and add rog-control-center on Startup
if command -v asusctl >/dev/null 2>&1; then
sed -i '/exec-once = rog-control-center &/s/^#//' config/hypr/UserConfigs/Startup_Apps.conf
fi
# Check if blueman-applet is installed and add blueman-applet on Startup
if command -v blueman-applet >/dev/null 2>&1; then
sed -i '/exec-once = blueman-applet &/s/^#//' config/hypr/UserConfigs/Startup_Apps.conf
fi
# Check if ags is installed edit ags behaviour on configs
if command -v ags >/dev/null 2>&1; then
sed -i '/#exec-once = ags &/s/^#//' config/hypr/UserConfigs/Startup_Apps.conf
sed -i '/#ags -q && ags &/s/^#//' config/hypr/scripts/RefreshNoWaybar.sh
sed -i '/#ags -q && ags &/s/^#//' config/hypr/scripts/Refresh.sh
fi
printf "\n%.0s" {1..1}
# Checking if neovim or vim is installed and offer user if they want to make as default editor
# Function to modify the ENVariables.conf file
update_editor() {
local editor=$1
sed -i "s/#env = EDITOR,.*/env = EDITOR,$editor #default editor/" config/hypr/UserConfigs/ENVariables.conf
echo "${OK} default editor set to ${MAGENTA}$editor${RESET}." 2>&1 | tee -a "$LOG"
}
EDITOR_SET=0
# Check for neovim if installed
if command -v nvim &> /dev/null; then
printf "${INFO} ${MAGENTA}neovim${RESET} is detected as installed\n"
read -p "${CAT} do you want to make ${MAGENTA}neovim${RESET} the default editor? (y/N): " EDITOR_CHOICE
if [[ "$EDITOR_CHOICE" == "y" ]]; then
update_editor "nvim"
EDITOR_SET=1
fi
fi
printf "\n"
# Check for vim if installed, but only if neovim wasn't chosen
if [[ "$EDITOR_SET" -eq 0 ]] && command -v vim &> /dev/null; then
printf "${INFO} ${MAGENTA}vim${RESET} is detected as installed\n"
read -p "${CAT} do you want to make ${MAGENTA}vim${RESET} the default editor? (y/N): " EDITOR_CHOICE
if [[ "$EDITOR_CHOICE" == "y" ]]; then
update_editor "vim"
EDITOR_SET=1
fi
fi
if [[ "$EDITOR_SET" -eq 0 ]]; then
echo "${YELLOW} Neither neovim nor vim is installed or selected as default." 2>&1 | tee -a "$LOG"
fi
printf "\n"