From 8878980ae46224ae2d5be3bb2ee914a85b0ab819 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Tue, 18 Mar 2025 23:56:16 +0900 Subject: note remove for nvim or vim not set --- copy.sh | 4 ---- 1 file changed, 4 deletions(-) (limited to 'copy.sh') diff --git a/copy.sh b/copy.sh index ab6dbe0c..22ec06b3 100755 --- a/copy.sh +++ b/copy.sh @@ -276,10 +276,6 @@ if [[ "$EDITOR_SET" -eq 0 ]] && command -v vim &> /dev/null; then 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" # Action to do for better appearance -- cgit v1.2.3 From e14c3e83f9df1d7a59dcd6791121a3a501f9d567 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Fri, 21 Mar 2025 17:06:23 +0900 Subject: hardware_cursor is disabled if nvidia gpu detected --- copy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'copy.sh') diff --git a/copy.sh b/copy.sh index 22ec06b3..2ec21f46 100755 --- a/copy.sh +++ b/copy.sh @@ -92,8 +92,8 @@ if lspci -k | grep -A 2 -E "(VGA|3D)" | grep -iq nvidia; then sed -i '/env = LIBVA_DRIVER_NAME,nvidia/s/^#//' config/hypr/UserConfigs/ENVariables.conf sed -i '/env = __GLX_VENDOR_LIBRARY_NAME,nvidia/s/^#//' config/hypr/UserConfigs/ENVariables.conf sed -i '/env = NVD_BACKEND,direct/s/^#//' config/hypr/UserConfigs/ENVariables.conf - #no hardware cursors if nvidia detected - #sed -i 's/^\([[:space:]]*no_hardware_cursors[[:space:]]*=[[:space:]]*\)2/\1 1/' config/hypr/UserConfigs/UserSettings.conf + # no hardware cursors if nvidia detected + sed -i 's/^\([[:space:]]*no_hardware_cursors[[:space:]]*=[[:space:]]*\)2/\1 1/' config/hypr/UserConfigs/UserSettings.conf #sed -i 's/^\([[:space:]]*explicit_sync[[:space:]]*=[[:space:]]*\)2/\1 0/' config/hypr/UserConfigs/UserSettings.conf fi -- cgit v1.2.3 From bc223cd808f330c7cd6ded76640cc8cb6d64a068 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 24 Mar 2025 13:15:01 +0900 Subject: adjusted copy.sh so proper window rule will be set depending on Hyprland version. Bumped to v2.3.15 --- config/hypr/UserConfigs/WindowRules-new.conf | 3 +- config/hypr/v2.3.15 | 5 +++ config/hypr/v2.3.15-dev | 5 --- copy.sh | 63 ++++++++++++++++++---------- 4 files changed, 47 insertions(+), 29 deletions(-) create mode 100644 config/hypr/v2.3.15 delete mode 100644 config/hypr/v2.3.15-dev (limited to 'copy.sh') diff --git a/config/hypr/UserConfigs/WindowRules-new.conf b/config/hypr/UserConfigs/WindowRules-new.conf index 05593108..ed40e842 100644 --- a/config/hypr/UserConfigs/WindowRules-new.conf +++ b/config/hypr/UserConfigs/WindowRules-new.conf @@ -2,8 +2,7 @@ # For window rules and layerrules # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more -# NOTES: Vaxry announced the deprecation of windowrulev2. Probably it will take effect on Hyprland v0.47.3. -# This is just to prepare for that. +# NOTES: This is only for Hyprland > 0.48. If you use copy.sh, no need to do anything # note for ja: This should NOT be implemented on Debian and Ubuntu diff --git a/config/hypr/v2.3.15 b/config/hypr/v2.3.15 new file mode 100644 index 00000000..31b3414d --- /dev/null +++ b/config/hypr/v2.3.15 @@ -0,0 +1,5 @@ +### https://github.com/JaKooLit ### +## https://github.com/JaKooLit/Hyprland-Dots +## This is to have a reference of which version would be + +## note that this will always be higher than the released versions \ No newline at end of file diff --git a/config/hypr/v2.3.15-dev b/config/hypr/v2.3.15-dev deleted file mode 100644 index 31b3414d..00000000 --- a/config/hypr/v2.3.15-dev +++ /dev/null @@ -1,5 +0,0 @@ -### https://github.com/JaKooLit ### -## https://github.com/JaKooLit/Hyprland-Dots -## This is to have a reference of which version would be - -## note that this will always be higher than the released versions \ No newline at end of file diff --git a/copy.sh b/copy.sh index 2ec21f46..7975aea9 100755 --- a/copy.sh +++ b/copy.sh @@ -124,18 +124,28 @@ fi printf "\n%.0s" {1..1} +# Extract Hyprland version (first occurrence of x.y.z after "Hyprland") +version_output=$(hyprctl version | awk '/^Hyprland/ {print $2}') + +# Check if version is 0.48.0 or higher +if [[ "$(printf '%s\n' "0.48.0" "$version_output" | sort -V | head -n1)" == "0.48.0" ]]; then + + mv config/hypr/UserConfigs/WindowRules.conf config/hypr/UserConfigs/WindowRules-old.conf + mv config/hypr/UserConfigs/WindowRules-new.conf config/hypr/UserConfigs/WindowRules.conf + + echo "$NOTE - Window Rule set up for Hyprland $version_output" +fi + +printf "\n%.0s" {1..1} + # Function to detect keyboard layout using localectl or setxkbmap detect_layout() { - if command -v localectl >/dev/null 2>&1; then - layout=$(localectl status --no-pager | awk '/X11 Layout/ {print $3}') - if [ -n "$layout" ]; then - echo "$layout" - fi - elif command -v setxkbmap >/dev/null 2>&1; then + if which localectl >/dev/null 2>&1; then + layout=$(localectl status --no-pager | grep 'X11 Layout' | awk '{print $3}') + [ -n "$layout" ] && echo "$layout" + elif which setxkbmap >/dev/null 2>&1; then layout=$(setxkbmap -query | grep layout | awk '{print $2}') - if [ -n "$layout" ]; then - echo "$layout" - fi + [ -n "$layout" ] && echo "$layout" fi } @@ -144,8 +154,9 @@ layout=$(detect_layout) if [ "$layout" = "(unset)" ]; then while true; do - printf "\n%.0s" {1..1} - print_color $WARNING " + printf "\n" + + print_color "$WARNING" " █▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█ STOP AND READ █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ @@ -165,8 +176,10 @@ ${MAGENTA} NOTE:${RESET} • You can also set more than 2 keyboard layouts • For example: ${YELLOW}us, kr, gb, ru${RESET} " - printf "\n%.0s" {1..1} - read -p "${CAT} - Please enter the correct keyboard layout: " new_layout + printf "\n" + + printf "%s - Please enter the correct keyboard layout: " "$CAT" + read new_layout if [ -n "$new_layout" ]; then layout="$new_layout" @@ -177,14 +190,17 @@ ${MAGENTA} NOTE:${RESET} done fi -printf "${NOTE} Detecting keyboard layout to prepare proper Hyprland Settings\n" +printf "\n" +printf "%s Detecting keyboard layout to prepare proper Hyprland Settings\n" "$NOTE" # Prompt the user to confirm whether the detected layout is correct while true; do - printf "${INFO} Current keyboard layout is ${MAGENTA}$layout${RESET}\n" - read -p "${CAT} Is this correct? [y/n] " keyboard_layout + printf "%s Current keyboard layout is %s%s%s\n" "$INFO" "$MAGENTA" "$layout" "$RESET" - case $keyboard_layout in + printf "%s Is this correct? [y/n] " "$CAT" + read keyboard_layout + + case "$keyboard_layout" in [yY]) awk -v layout="$layout" '/kb_layout/ {$0 = " kb_layout = " layout} 1' config/hypr/UserConfigs/UserSettings.conf > temp.conf mv temp.conf config/hypr/UserConfigs/UserSettings.conf @@ -192,8 +208,10 @@ while true; do echo "${NOTE} kb_layout ${MAGENTA}$layout${RESET} configured in settings." 2>&1 | tee -a "$LOG" break ;; [nN]) - printf "\n%.0s" {1..2} - print_color $WARNING " + printf "\n" + printf "\n" + + print_color "$WARNING" " █▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█ STOP AND READ █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ @@ -213,9 +231,10 @@ ${MAGENTA} NOTE:${RESET} • You can also set more than 2 keyboard layouts • For example: ${YELLOW}us, kr, gb, ru${RESET} " - printf "\n%.0s" {1..1} - - read -p "${CAT} - Please enter the correct keyboard layout: " new_layout + printf "\n" + + printf "%s - Please enter the correct keyboard layout: " "$CAT" + read new_layout awk -v new_layout="$new_layout" '/kb_layout/ {$0 = " kb_layout = " new_layout} 1' config/hypr/UserConfigs/UserSettings.conf > temp.conf mv temp.conf config/hypr/UserConfigs/UserSettings.conf -- cgit v1.2.3 From da6cb8d5c28f19716bba694b3e258a266e0a67f8 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 24 Mar 2025 13:47:26 +0900 Subject: adjusted copy.sh to work even with fishy shell --- copy.sh | 96 +++++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 58 insertions(+), 38 deletions(-) (limited to 'copy.sh') diff --git a/copy.sh b/copy.sh index 7975aea9..8a23336f 100755 --- a/copy.sh +++ b/copy.sh @@ -140,12 +140,16 @@ printf "\n%.0s" {1..1} # Function to detect keyboard layout using localectl or setxkbmap detect_layout() { - if which localectl >/dev/null 2>&1; then - layout=$(localectl status --no-pager | grep 'X11 Layout' | awk '{print $3}') - [ -n "$layout" ] && echo "$layout" - elif which setxkbmap >/dev/null 2>&1; then + if command -v localectl >/dev/null 2>&1; then + layout=$(localectl status --no-pager | awk '/X11 Layout/ {print $3}') + if [ -n "$layout" ]; then + echo "$layout" + fi + elif command -v setxkbmap >/dev/null 2>&1; then layout=$(setxkbmap -query | grep layout | awk '{print $2}') - [ -n "$layout" ] && echo "$layout" + if [ -n "$layout" ]; then + echo "$layout" + fi fi } @@ -154,9 +158,8 @@ layout=$(detect_layout) if [ "$layout" = "(unset)" ]; then while true; do - printf "\n" - - print_color "$WARNING" " + printf "\n%.0s" {1..1} + print_color $WARNING " █▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█ STOP AND READ █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ @@ -176,9 +179,9 @@ ${MAGENTA} NOTE:${RESET} • You can also set more than 2 keyboard layouts • For example: ${YELLOW}us, kr, gb, ru${RESET} " - printf "\n" - - printf "%s - Please enter the correct keyboard layout: " "$CAT" + printf "\n%.0s" {1..1} + + echo -n "${CAT} - Please enter the correct keyboard layout: " read new_layout if [ -n "$new_layout" ]; then @@ -190,17 +193,15 @@ ${MAGENTA} NOTE:${RESET} done fi -printf "\n" -printf "%s Detecting keyboard layout to prepare proper Hyprland Settings\n" "$NOTE" +printf "${NOTE} Detecting keyboard layout to prepare proper Hyprland Settings\n" # Prompt the user to confirm whether the detected layout is correct while true; do - printf "%s Current keyboard layout is %s%s%s\n" "$INFO" "$MAGENTA" "$layout" "$RESET" - - printf "%s Is this correct? [y/n] " "$CAT" + printf "${INFO} Current keyboard layout is ${MAGENTA}$layout${RESET}\n" + echo -n "${CAT} Is this correct? [y/n] " read keyboard_layout - case "$keyboard_layout" in + case $keyboard_layout in [yY]) awk -v layout="$layout" '/kb_layout/ {$0 = " kb_layout = " layout} 1' config/hypr/UserConfigs/UserSettings.conf > temp.conf mv temp.conf config/hypr/UserConfigs/UserSettings.conf @@ -208,10 +209,8 @@ while true; do echo "${NOTE} kb_layout ${MAGENTA}$layout${RESET} configured in settings." 2>&1 | tee -a "$LOG" break ;; [nN]) - printf "\n" - printf "\n" - - print_color "$WARNING" " + printf "\n%.0s" {1..2} + print_color $WARNING " █▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█ STOP AND READ █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ @@ -231,9 +230,9 @@ ${MAGENTA} NOTE:${RESET} • You can also set more than 2 keyboard layouts • For example: ${YELLOW}us, kr, gb, ru${RESET} " - printf "\n" - - printf "%s - Please enter the correct keyboard layout: " "$CAT" + printf "\n%.0s" {1..1} + + echo -n "${CAT} - Please enter the correct keyboard layout: " read new_layout awk -v new_layout="$new_layout" '/kb_layout/ {$0 = " kb_layout = " new_layout} 1' config/hypr/UserConfigs/UserSettings.conf > temp.conf @@ -276,8 +275,9 @@ 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 + echo -n "${CAT} Do you want to make ${MAGENTA}neovim${RESET} the default editor? (y/N): " + read EDITOR_CHOICE + if [[ "$EDITOR_CHOICE" == "y" || "$EDITOR_CHOICE" == "Y" ]]; then update_editor "nvim" EDITOR_SET=1 fi @@ -288,8 +288,9 @@ 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 + echo -n "${CAT} Do you want to make ${MAGENTA}vim${RESET} the default editor? (y/N): " + read EDITOR_CHOICE + if [[ "$EDITOR_CHOICE" == "y" || "$EDITOR_CHOICE" == "Y" ]]; then update_editor "vim" EDITOR_SET=1 fi @@ -305,7 +306,9 @@ while true; do echo "${MAGENTA}Select monitor resolution to properly configure appearance and fonts:" echo "$YELLOW -- Enter 1. for monitor resolution less than 1440p (< 1440p)" echo "$YELLOW -- Enter 2. for monitor resolution equal to or higher than 1440p (≥ 1440p)" - read -p "$CAT Enter the number of your choice (1 or 2): " res_choice + + echo -n "$CAT Enter the number of your choice (1 or 2): " + read res_choice case $res_choice in 1) @@ -351,7 +354,8 @@ printf "\n%.0s" {1..1} # Ask whether to change to 12hr format while true; do echo -e "${NOTE} ${SKY_BLUE} By default, KooL's Dots are configured in 24H clock format." - read -p "$CAT Do you want to change to 12H (AM/PM) clock format? (y/n): " answer + echo -n "$CAT Do you want to change to 12H (AM/PM) clock format? (y/n): " + read answer # Convert the answer to lowercase for comparison answer=$(echo "$answer" | tr '[:upper:]' '[:lower:]') @@ -435,14 +439,20 @@ printf "\n%.0s" {1..1} echo "${NOTE} ${SKY_BLUE}By default, Rainbow Borders animation is enabled" echo "${WARN} However, this uses a bit more CPU and Memory resources." -read -p "${CAT} Do you want to disable Rainbow Borders animation? (y/N): " border_choice +# Ask whether to disable Rainbow Borders animation +echo -n "${CAT} Do you want to disable Rainbow Borders animation? (y/N): " +read border_choice + +# Check user's choice if [[ "$border_choice" =~ ^[Yy]$ ]]; then + # Disable Rainbow Borders mv config/hypr/UserScripts/RainbowBorders.sh config/hypr/UserScripts/RainbowBorders.bak.sh + # Comment out the exec-once and animation lines sed -i '/exec-once = \$UserScripts\/RainbowBorders.sh/s/^/#/' config/hypr/UserConfigs/Startup_Apps.conf sed -i '/^[[:space:]]*animation = borderangle, 1, 180, liner, loop/s/^/#/' config/hypr/UserConfigs/UserAnimations.conf - echo "${OK} Rainbow borders is now disabled." 2>&1 | tee -a "$LOG" + echo "${OK} Rainbow borders are now disabled." 2>&1 | tee -a "$LOG" else echo "${NOTE} No changes made. Rainbow borders remain enabled." 2>&1 | tee -a "$LOG" fi @@ -473,7 +483,9 @@ for DIR2 in $DIRS; do if [ -d "$DIRPATH" ]; then while true; do printf "\n${INFO} Found ${YELLOW}$DIR2${RESET} config found in ~/.config/\n" - read -p "${CAT} Do you want to replace ${YELLOW}$DIR2${RESET} config? (y/n): " DIR1_CHOICE + echo -n "${CAT} Do you want to replace ${YELLOW}$DIR2${RESET} config? (y/n): " + read DIR1_CHOICE + case "$DIR1_CHOICE" in [Yy]* ) BACKUP_DIR=$(get_backup_dirname) @@ -528,7 +540,9 @@ DIRW="waybar" DIRPATHw="$HOME/.config/$DIRW" if [ -d "$DIRPATHw" ]; then while true; do - read -p "${CAT} Do you want to replace ${YELLOW}$DIRW${RESET} config? (y/n): " DIR1_CHOICE + echo -n "${CAT} Do you want to replace ${YELLOW}$DIRW${RESET} config? (y/n): " + read DIR1_CHOICE + case "$DIR1_CHOICE" in [Yy]* ) BACKUP_DIR=$(get_backup_dirname) @@ -745,7 +759,8 @@ if [ -d "$BACKUP_DIR_PATH" ]; then BACKUP_FILE="$BACKUP_DIR_PATH/$FILE_NAME" if [ -f "$BACKUP_FILE" ]; then printf "\n${INFO} Found ${YELLOW}$FILE_NAME${RESET} in hypr backup...\n" - read -p "${CAT} Do you want to restore ${YELLOW}$FILE_NAME${RESET} from backup? (y/N): " file_restore + echo -n "${CAT} Do you want to restore ${YELLOW}$FILE_NAME${RESET} from backup? (y/N): " + read file_restore if [[ "$file_restore" == [Yy]* ]]; then if cp "$BACKUP_FILE" "$DIRPATH/UserConfigs/$FILE_NAME"; then @@ -781,7 +796,9 @@ if [ -d "$BACKUP_DIR_PATH_S" ]; then if [ -f "$BACKUP_SCRIPT" ]; then printf "\n${INFO} Found ${YELLOW}$SCRIPT_NAME${RESET} in hypr backup...\n" - read -p "${CAT} Do you want to restore ${YELLOW}$SCRIPT_NAME${RESET} from backup? (y/N): " script_restore + echo -n "${CAT} Do you want to restore ${YELLOW}$SCRIPT_NAME${RESET} from backup? (y/N): " + read script_restore + if [[ "$script_restore" == [Yy]* ]]; then if cp "$BACKUP_SCRIPT" "$DIRSHPATH/UserScripts/$SCRIPT_NAME"; then echo "${OK} - $SCRIPT_NAME restored!" 2>&1 | tee -a "$LOG" @@ -816,7 +833,8 @@ if [ -d "$BACKUP_DIR_PATH_F" ]; then if [ -f "$BACKUP_FILE" ]; then echo -e "\n${INFO} Found ${YELLOW}$FILE_RESTORE${RESET} in hypr backup..." - read -p "${CAT} Do you want to restore ${YELLOW}$FILE_RESTORE${RESET} from backup? (y/N): " file2restore + echo -n "${CAT} Do you want to restore ${YELLOW}$FILE_RESTORE${RESET} from backup? (y/N): " + read file2restore if [[ "$file2restore" == [Yy]* ]]; then if cp "$BACKUP_FILE" "$DIRPATH/$FILE_RESTORE"; then @@ -987,7 +1005,9 @@ cleanup_backups() { echo " - ${BACKUP##*/}" done - read -p "${CAT} Do you want to delete the older backups of ${YELLOW}${DIR##*/}${RESET} and keep the latest backup only? (y/N): " back_choice + echo -n "${CAT} Do you want to delete the older backups of ${YELLOW}${DIR##*/}${RESET} and keep the latest backup only? (y/N): " + read back_choice + if [[ "$back_choice" == [Yy]* ]]; then # Sort backups by modification time latest_backup="${BACKUP_DIRS[0]}" -- cgit v1.2.3 From 57fbdc104615a9de7f89275a23e2b3b1089b6037 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 24 Mar 2025 13:52:43 +0900 Subject: another adjustment for copy.sh to work even with fishy shell --- copy.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'copy.sh') diff --git a/copy.sh b/copy.sh index 8a23336f..1a9ec38d 100755 --- a/copy.sh +++ b/copy.sh @@ -915,7 +915,8 @@ printf "\n%.0s" {1..1} sddm_sequioa="/usr/share/sddm/themes/sequoia_2" if [ -d "$sddm_sequioa" ]; then while true; do - read -rp "${CAT} SDDM sequoia_2 theme detected! Apply current wallpaper as SDDM background? (y/n): " SDDM_WALL + echo "${CAT} SDDM sequoia_2 theme detected! Apply current wallpaper as SDDM background? (y/n): " + read SDDM_WALL # Remove any leading/trailing whitespace or newlines from input SDDM_WALL=$(echo "$SDDM_WALL" | tr -d '\n' | tr -d ' ') @@ -943,7 +944,9 @@ printf "\n%.0s" {1..1} echo "${MAGENTA}By default only a few wallpapers are copied${RESET}..." while true; do - read -rp "${CAT} Would you like to download additional wallpapers? ${WARN} This is 1GB in size (y/n): " WALL + echo "${CAT} Would you like to download additional wallpapers? ${WARN} This is 1GB in size (y/n): " + read WALL + case $WALL in [Yy]) echo "${NOTE} Downloading additional wallpapers..." -- cgit v1.2.3