From d6525cb0523e740940358dec2580ffdb583fd1cf Mon Sep 17 00:00:00 2001 From: kRHYME7 Date: Fri, 13 Sep 2024 02:31:24 +0800 Subject: [PATCH] feat (Hyde code ) : Supports Cursor IDE --- Hyde | 2 +- Scripts/FUNCTIONS-hyde | 2 +- Scripts/change_variable.sh | 37 ------------------------------------- 3 files changed, 2 insertions(+), 39 deletions(-) delete mode 100644 Scripts/change_variable.sh diff --git a/Hyde b/Hyde index ecb34f0..ccef160 100755 --- a/Hyde +++ b/Hyde @@ -754,7 +754,7 @@ HELP } codet=${*:-wallbash} [[ "$*" == "-"* ]] && { help ; exit 1; } - readarray -t codeConf < <(find "${confDir}" -mindepth 1 -maxdepth 1 -type d -name "Code*" -o -name "VSCodium*" | sort) + readarray -t codeConf < <(find "${confDir}" -mindepth 1 -maxdepth 1 -type d -name "Code*" -o -name "VSCodium*" -o -name "Cursor" | sort) print_prompt -y "Setting '${codet}' as code theme..." for i in "${!codeConf[@]}" ; do [ -f "${codeConf[i]}/User/settings.json" ] || continue diff --git a/Scripts/FUNCTIONS-hyde b/Scripts/FUNCTIONS-hyde index f01294c..b735b79 100644 --- a/Scripts/FUNCTIONS-hyde +++ b/Scripts/FUNCTIONS-hyde @@ -81,7 +81,7 @@ SelectOption() { #! Can be improved soon using other package.:- Used fzf. ConfigCtl() { FILE="$1" - EDITOR="${EDITOR:-code}" #* Use VS Code as the default editor + EDITOR="${EDITOR:-xdg-open}" #* Use VS Code as the default editor echo -e "[Editor]: $EDITOR (\"export EDITOR=pref_editor\") \n[Modifying]: $FILE \nPress Any Key if done editing" #kitty -o allow_remote_control=yes -o listen_on=unix:/${HYDE_RUNTIME_DIR}/mykitty $(which $EDITOR) "$FILE" > /dev/null 2>&1 & kitty "$(which $EDITOR)" "$FILE" >/dev/null 2>&1 & diff --git a/Scripts/change_variable.sh b/Scripts/change_variable.sh deleted file mode 100644 index 3cb20bd..0000000 --- a/Scripts/change_variable.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -defKeys="${1:-$HOME/.config/hypr/keybindings.conf}" -usrKeys="${2:-$HOME/.config/hypr/userprefs.conf}" #Overrides -backupFile=$(mktemp) - - -# Create a backup of the defKeys file -cp "$defKeys" "$backupFile" - -#? Handles Variables to overwrite existing variables. -usrVar=$(grep '^\s*\$.*=' "$usrKeys" | sed 's/^[ \t]*//' ) -defVar=$(grep '^\s*\$.*=' "$defKeys" | sed 's/^[ \t]*//' | cut -d'=' -f 1) - -IFS=$'\n' read -rd '' -a usrVarValArray <<<"$usrVar" - -for line in "${usrVarValArray[@]}"; do - varName=$(echo "$line" | cut -d '=' -f 1) - varValue=$(echo "$line" | cut -d '=' -f 2) -if grep -Ff <(echo "$varName") <(echo "$defVar") > /dev/null ; then - sed -i "s/^$varName.*$/$varName=$varValue/" "$defKeys" - fi -done - -echo -e "Variable defaults: \n$(grep '^\s*\$.*=' "$defKeys" | sed 's/^[ \t]*//' )" - -# Ask for user confirmation to keep the changes -echo "Please try to check if your configuration are still correct." -echo "Would you like to keep the changes? " -read -n 1 -s -r -p "[ENTER:yes ANY:no]" -if [[ $REPLY != "" ]]; then - echo -e "\nOperation cancelled by user." - # Restore the defKeys file from the backup - mv "$backupFile" "$defKeys" - exit 0 -fi -echo -e "\n[OK]" \ No newline at end of file