From a31e55ca4acac4bc256b6bb38915b6e414da90ad Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sun, 11 Jan 2026 02:30:05 -0500 Subject: Moved the prompts for keyboard, resolution, clock, rainbow borders Further modularizing the copy.sh script The express upgrade is almost moved here On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: copy.sh new file: scripts/lib_prompts.sh --- scripts/lib_prompts.sh | 256 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 256 insertions(+) create mode 100644 scripts/lib_prompts.sh (limited to 'scripts/lib_prompts.sh') diff --git a/scripts/lib_prompts.sh b/scripts/lib_prompts.sh new file mode 100644 index 00000000..16931892 --- /dev/null +++ b/scripts/lib_prompts.sh @@ -0,0 +1,256 @@ +#!/usr/bin/env bash +# User interaction helpers extracted from copy.sh. Each helper echoes state or sets +# globals deliberately to minimize side effects. + +# Detect keyboard layout via localectl or setxkbmap. +prompt_detect_layout() { + if command -v localectl >/dev/null 2>&1; then + local layout + layout=$(localectl status --no-pager | awk '/X11 Layout/ {print $3}') + [ -n "$layout" ] && { echo "$layout"; return; } + fi + if command -v setxkbmap >/dev/null 2>&1; then + local layout + layout=$(setxkbmap -query | awk '/layout/ {print $2}') + [ -n "$layout" ] && { echo "$layout"; return; } + fi + echo "(unset)" +} + +# Confirm or set keyboard layout; writes to SystemSettings.conf. +prompt_keyboard_layout() { + local layout="$1" + local log="$2" + + if [ "$layout" = "(unset)" ]; then + while true; do + printf "\n%.0s" {1..1} + print_color $WARNING "\n █▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█ + STOP AND READ + █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ + + !!! IMPORTANT WARNING !!! + +The Default Keyboard Layout could not be detected +You need to set it Manually + + !!! WARNING !!! + +Setting a wrong Keyboard Layout will cause Hyprland to crash +If you are not sure, just type ${YELLOW}us${RESET} +${SKYBLUE}You can change later in ~/.config/hypr/UserConfigs/UserSettings.conf${RESET} + +${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} + + echo -n "${CAT} - Please enter the correct keyboard layout: " + read new_layout + + if [ -n "$new_layout" ]; then + layout="$new_layout" + break + else + echo "${CAT} Please enter a keyboard layout." + fi + done + fi + + printf "${NOTE} Detecting keyboard layout to prepare proper Hyprland Settings\n" + while true; do + 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 + [yY]) + awk -v layout="$layout" '/kb_layout/ {$0 = " kb_layout = " layout} 1' config/hypr/configs/SystemSettings.conf >temp.conf + mv temp.conf config/hypr/configs/SystemSettings.conf + 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 " + █▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█ + STOP AND READ + █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ + + !!! IMPORTANT WARNING !!! + +The Default Keyboard Layout could not be detected +You need to set it Manually + + !!! WARNING !!! + +Setting a wrong Keyboard Layout will cause Hyprland to crash +If you are not sure, just type ${YELLOW}us${RESET} +${SKYBLUE}You can change later in ~/.config/hypr/UserConfigs/UserSettings.conf${RESET} + +${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} + 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/configs/SystemSettings.conf >temp.conf + mv temp.conf config/hypr/configs/SystemSettings.conf + echo "${OK} kb_layout $new_layout configured in settings." 2>&1 | tee -a "$log" + break + ;; + *) + echo "${ERROR} Please enter either 'y' or 'n'." + ;; + esac + done +} + +# Prompt for resolution choice; echoes "< 1440p" or "≥ 1440p". +prompt_resolution_choice() { + local choice + while true; do + echo "${NOTE} ${SKY_BLUE} By default, KooL's Dots are configured for 1440p or 2k." + echo "${WARN} If you dont select proper resolution, Hyprlock will look FUNKY!" + echo "${INFO} If you are not sure what is your resolution, choose 1 here!" + 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)" + + echo -n "$CAT Enter the number of your choice (1 or 2): " + read choice + case $choice in + 1) echo "< 1440p"; return ;; + 2) echo "≥ 1440p"; return ;; + *) echo "${ERROR} Invalid choice. Please enter 1 for < 1440p or 2 for ≥ 1440p." ;; + esac + done +} + +# Prompt for 12H clock; sets waybar/hyprlock/SDDM changes when accepted. +prompt_clock_12h() { + local log="$1" + while true; do + echo -e "${NOTE} ${SKY_BLUE} By default, KooL's Dots are configured in 24H clock format." + echo -n "$CAT Do you want to change to 12H (AM/PM) clock format? (y/n): " + read answer + answer=$(echo "$answer" | tr '[:upper:]' '[:lower:]') + if [[ "$answer" == "y" ]]; then + # waybar clocks + sed -i 's#^\(\s*\)//\("format": " {:%I:%M %p}",\) #\1\2 #g' config/waybar/Modules 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)\("format": " {:%H:%M:%S}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)\("format": " {:%H:%M}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)//\("format": "{:%I:%M %p - %d/%b}",\) #\1\2#g' config/waybar/Modules 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)\("format": "{:%H:%M - %d/%b}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)//\("format": "{:%B | %a %d, %Y | %I:%M %p}",\) #\1\2#g' config/waybar/Modules 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)\("format": "{:%B | %a %d, %Y | %H:%M}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)//\("format": "{:%A, %I:%M %P}",\) #\1\2#g' config/waybar/Modules 2>&1 | tee -a "$log" + sed -i 's#^\(\s*\)\("format": "{:%a %d | %H:%M}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$log" + + # hyprlock + local HYPRLOCK_FILE="config/hypr/hyprlock.conf" + if [ ! -f "$HYPRLOCK_FILE" ] && [ -f "config/hypr/hyprlock-1080p.conf" ]; then + HYPRLOCK_FILE="config/hypr/hyprlock-1080p.conf" + fi + if [ -f "$HYPRLOCK_FILE" ]; then + sed -i 's/^\s*text = cmd\[update:1000\] echo \"\$(date +\"%H\")\"/# &/' "$HYPRLOCK_FILE" 2>&1 | tee -a "$log" + sed -i 's/^\(\s*\)# *text = cmd\[update:1000\] echo \"\$(date +\"%I\")\" #AM\/PM/\1 text = cmd\[update:1000\] echo \"\$(date +\"%I\")\" #AM\/PM/' "$HYPRLOCK_FILE" 2>&1 | tee -a "$log" + sed -i 's/^\s*text = cmd\[update:1000\] echo \"\$(date +\"%S\")\"/# &/' "$HYPRLOCK_FILE" 2>&1 | tee -a "$log" + sed -i 's/^\(\s*\)# *text = cmd\[update:1000\] echo \"\$(date +\"%S %p\")\" #AM\/PM/\1 text = cmd\[update:1000\] echo \"\$(date +\"%S %p\")\" #AM\/PM/' "$HYPRLOCK_FILE" 2>&1 | tee -a "$log" + else + echo "${WARN} hyprlock template not found; skipping 12H lock format edits" 2>&1 | tee -a "$log" + fi + + # SDDM themes + apply_sddm_12h_format "/usr/share/sddm/themes/simple-sddm" "$log" + apply_sddm_12h_format "/usr/share/sddm/themes/simple_sddm_2" "$log" + apply_sddm_12h_format_sequoia "/usr/share/sddm/themes/sequoia_2" "$log" + echo "${OK} 12H format set on waybar clocks succesfully." 2>&1 | tee -a "$log" + return + elif [[ "$answer" == "n" ]]; then + echo "${NOTE} You chose not to change to 12H format." 2>&1 | tee -a "$log" + return + else + echo "${ERROR} Invalid choice. Please enter y for yes or n for no." + fi + done +} + +apply_sddm_12h_format() { + local sddm_directory="$1" + local log="$2" + if [ -d "$sddm_directory" ]; then + echo "Editing ${SKY_BLUE}$sddm_directory${RESET} to 12H format" 2>&1 | tee -a "$log" + sudo sed -i 's|^## HourFormat=\"hh:mm AP\"|HourFormat=\"hh:mm AP\"|' "$sddm_directory/theme.conf" 2>&1 | tee -a "$log" || true + sudo sed -i 's|^HourFormat=\"HH:mm\"|## HourFormat=\"HH:mm\"|' "$sddm_directory/theme.conf" 2>&1 | tee -a "$log" || true + fi +} + +apply_sddm_12h_format_sequoia() { + local sddm_directory="$1" + local log="$2" + if [ -d "$sddm_directory" ]; then + echo "${YELLOW}sddm sequoia_2${RESET} theme exists. Editing to 12H format" 2>&1 | tee -a "$log" + sudo sed -i 's|^clockFormat=\"HH:mm\"|## clockFormat=\"HH:mm\"|' "$sddm_directory/theme.conf" 2>&1 | tee -a "$log" || true + if ! grep -q 'clockFormat=\"hh:mm AP\"' "$sddm_directory/theme.conf"; then + sudo sed -i '/^clockFormat=/a clockFormat=\"hh:mm AP\"' "$sddm_directory/theme.conf" 2>&1 | tee -a "$log" || true + fi + echo "${OK} 12H format set to SDDM successfully." 2>&1 | tee -a "$log" + fi +} + +# Rainbow borders toggle; returns "disabled" or "kept". +prompt_rainbow_borders() { + local log="$1" + echo "${NOTE} ${SKY_BLUE}By default, Rainbow Borders animation is enabled" + echo "${WARN} However, this uses a bit more CPU and Memory resources." + echo -n "${CAT} Do you want to disable Rainbow Borders animation? (y/N): " + read border_choice + if [[ "$border_choice" =~ ^[Yy]$ ]]; then + mv config/hypr/UserScripts/RainbowBorders.sh config/hypr/UserScripts/RainbowBorders.bak.sh + sed -i '/exec-once = \$UserScripts\/RainbowBorders.sh/s/^/#/' config/hypr/configs/Startup_Apps.conf + sed -i '/^[[:space:]]*animation = borderangle, 1, 180, liner, loop/s/^/#/' config/hypr/configs/UserAnimations.conf + echo "${OK} Rainbow borders are now disabled." 2>&1 | tee -a "$log" + echo "disabled" + else + echo "${NOTE} No changes made. Rainbow borders remain enabled." 2>&1 | tee -a "$log" + echo "kept" + fi +} + +# Express upgrade confirmation; may set EXPRESS_MODE=1. +prompt_express_upgrade() { + local express_supported="$1" + local log="$2" + if [ "$EXPRESS_MODE" -eq 1 ] && [ "$express_supported" -eq 0 ]; then + echo "${NOTE} Express mode requires installed dotfiles v${MIN_EXPRESS_VERSION} or newer. Continuing with standard upgrade prompts." 2>&1 | tee -a "$log" + EXPRESS_MODE=0 + return + fi + if [ "$UPGRADE_MODE" -eq 1 ] && [ "$EXPRESS_MODE" -eq 0 ]; then + if [ "$express_supported" -eq 0 ]; then + echo "${NOTE} Express mode requires installed dotfiles v${MIN_EXPRESS_VERSION} or newer. Continuing with standard upgrade prompts." 2>&1 | tee -a "$log" + else + while true; do + echo "${NOTE} Express mode skips config restore prompts, SDDM/background questions, and trims old backups." + echo -n "${CAT} Do you want to continue with EXPRESS upgrade mode? (y/N): " + read express_choice + case "$express_choice" in + [Yy]) + EXPRESS_MODE=1 + echo "${INFO} Express mode enabled for this upgrade." 2>&1 | tee -a "$log" + break + ;; + [Nn] | "") + echo "${NOTE} Continuing with standard upgrade prompts." 2>&1 | tee -a "$log" + break + ;; + *) + echo "${WARN} Please answer y or n." + ;; + esac + done + fi + fi +} -- cgit v1.2.3 From e73e6a5ce96a7fd0e849cd112321e3160bedff80 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sun, 11 Jan 2026 02:39:15 -0500 Subject: fixing prompts for resolution, clock, etc On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: copy.sh modified: scripts/lib_prompts.sh --- copy.sh | 3 +-- scripts/lib_prompts.sh | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/lib_prompts.sh') diff --git a/copy.sh b/copy.sh index aa634fd3..0a68ea02 100755 --- a/copy.sh +++ b/copy.sh @@ -360,7 +360,7 @@ if [[ "$EDITOR_SET" -eq 0 ]] && command -v vim &>/dev/null; then fi printf "\n" - +echo "${INFO} Awaiting monitor resolution selection (1=<1440p, 2=≥1440p)..." 2>&1 | tee -a "$LOG" resolution=$(prompt_resolution_choice) echo "${OK} You have chosen $resolution resolution." 2>&1 | tee -a "$LOG" if [ "$resolution" == "< 1440p" ]; then @@ -384,7 +384,6 @@ if [ "$resolution" == "< 1440p" ]; then fi printf "\n%.0s" {1..1} - prompt_clock_12h "$LOG" printf "\n%.0s" {1..1} prompt_rainbow_borders "$LOG" >/dev/null diff --git a/scripts/lib_prompts.sh b/scripts/lib_prompts.sh index 16931892..ae493842 100644 --- a/scripts/lib_prompts.sh +++ b/scripts/lib_prompts.sh @@ -111,6 +111,7 @@ ${MAGENTA} NOTE:${RESET} prompt_resolution_choice() { local choice while true; do + echo "${INFO:-[INFO]} Resolution selection required (1 = <1440p, 2 = ≥1440p)" echo "${NOTE} ${SKY_BLUE} By default, KooL's Dots are configured for 1440p or 2k." echo "${WARN} If you dont select proper resolution, Hyprlock will look FUNKY!" echo "${INFO} If you are not sure what is your resolution, choose 1 here!" -- cgit v1.2.3 From 292bbd0bce87926157a58f2f1f6a73046a122130 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sun, 11 Jan 2026 02:43:22 -0500 Subject: Fixing resoltion prmpt --- copy.sh | 1 - scripts/lib_prompts.sh | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'scripts/lib_prompts.sh') diff --git a/copy.sh b/copy.sh index 0a68ea02..d35af646 100755 --- a/copy.sh +++ b/copy.sh @@ -360,7 +360,6 @@ if [[ "$EDITOR_SET" -eq 0 ]] && command -v vim &>/dev/null; then fi printf "\n" -echo "${INFO} Awaiting monitor resolution selection (1=<1440p, 2=≥1440p)..." 2>&1 | tee -a "$LOG" resolution=$(prompt_resolution_choice) echo "${OK} You have chosen $resolution resolution." 2>&1 | tee -a "$LOG" if [ "$resolution" == "< 1440p" ]; then diff --git a/scripts/lib_prompts.sh b/scripts/lib_prompts.sh index ae493842..45772abb 100644 --- a/scripts/lib_prompts.sh +++ b/scripts/lib_prompts.sh @@ -119,9 +119,8 @@ prompt_resolution_choice() { 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)" - echo -n "$CAT Enter the number of your choice (1 or 2): " - read choice - case $choice in + read -r -p "${CAT} Enter the number of your choice (1 or 2): " choice + case "$choice" in 1) echo "< 1440p"; return ;; 2) echo "≥ 1440p"; return ;; *) echo "${ERROR} Invalid choice. Please enter 1 for < 1440p or 2 for ≥ 1440p." ;; -- cgit v1.2.3 From 27dae2e40ac4fa27cc55a7fa90927fb47a641a85 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sun, 11 Jan 2026 02:44:51 -0500 Subject: Fixed res prompt --- scripts/lib_prompts.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'scripts/lib_prompts.sh') diff --git a/scripts/lib_prompts.sh b/scripts/lib_prompts.sh index 45772abb..ce75462c 100644 --- a/scripts/lib_prompts.sh +++ b/scripts/lib_prompts.sh @@ -111,13 +111,9 @@ ${MAGENTA} NOTE:${RESET} prompt_resolution_choice() { local choice while true; do - echo "${INFO:-[INFO]} Resolution selection required (1 = <1440p, 2 = ≥1440p)" - echo "${NOTE} ${SKY_BLUE} By default, KooL's Dots are configured for 1440p or 2k." - echo "${WARN} If you dont select proper resolution, Hyprlock will look FUNKY!" - echo "${INFO} If you are not sure what is your resolution, choose 1 here!" - 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)" + echo "${INFO:-[INFO]} Select monitor resolution for scaling:" + echo " 1) < 1440p (lower DPI; smaller displays)" + echo " 2) ≥ 1440p (default; 1440p/2k/4k)" read -r -p "${CAT} Enter the number of your choice (1 or 2): " choice case "$choice" in -- cgit v1.2.3 From bf494381829c904425b8bda46b087572b09e7ca4 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sun, 11 Jan 2026 02:46:11 -0500 Subject: Fixed banner --- scripts/lib_prompts.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts/lib_prompts.sh') diff --git a/scripts/lib_prompts.sh b/scripts/lib_prompts.sh index ce75462c..6f426b53 100644 --- a/scripts/lib_prompts.sh +++ b/scripts/lib_prompts.sh @@ -115,7 +115,11 @@ prompt_resolution_choice() { echo " 1) < 1440p (lower DPI; smaller displays)" echo " 2) ≥ 1440p (default; 1440p/2k/4k)" - read -r -p "${CAT} Enter the number of your choice (1 or 2): " choice + if ! read -r -p "${CAT} Enter the number of your choice (1 or 2): " choice Date: Sun, 11 Jan 2026 02:50:31 -0500 Subject: Fixd issues with sddm wallpaper set code --- copy.sh | 2 +- scripts/lib_prompts.sh | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'scripts/lib_prompts.sh') diff --git a/copy.sh b/copy.sh index 0553865a..5275eeb5 100755 --- a/copy.sh +++ b/copy.sh @@ -1083,7 +1083,7 @@ elif [ -d "$sddm_simple_sddm_2" ]; then case $SDDM_WALL in [Yy]) # Copy the wallpaper, ignore errors if the file exists or fails - sudo cp -r "config/hypr/wallpaper_effects/.wallpaper_current" "/usr/share/sddm/themes/simple_sddm_2/Backgrounds/default" || true + sudo -n cp -r "config/hypr/wallpaper_effects/.wallpaper_current" "/usr/share/sddm/themes/simple_sddm_2/Backgrounds/default" || true echo "${NOTE} Current wallpaper applied as default SDDM background" 2>&1 | tee -a "$LOG" break ;; diff --git a/scripts/lib_prompts.sh b/scripts/lib_prompts.sh index 6f426b53..dcad7682 100644 --- a/scripts/lib_prompts.sh +++ b/scripts/lib_prompts.sh @@ -182,8 +182,11 @@ apply_sddm_12h_format() { local log="$2" if [ -d "$sddm_directory" ]; then echo "Editing ${SKY_BLUE}$sddm_directory${RESET} to 12H format" 2>&1 | tee -a "$log" - sudo sed -i 's|^## HourFormat=\"hh:mm AP\"|HourFormat=\"hh:mm AP\"|' "$sddm_directory/theme.conf" 2>&1 | tee -a "$log" || true - sudo sed -i 's|^HourFormat=\"HH:mm\"|## HourFormat=\"HH:mm\"|' "$sddm_directory/theme.conf" 2>&1 | tee -a "$log" || true + if ! sudo -n sed -i 's|^## HourFormat="hh:mm AP"|HourFormat="hh:mm AP"|' "$sddm_directory/theme.conf" 2>&1 | tee -a "$log"; then + echo "${WARN:-[WARN]} Skipping SDDM 12H edit (sudo password required)." 2>&1 | tee -a "$log" + return + fi + sudo -n sed -i 's|^HourFormat="HH:mm"|## HourFormat="HH:mm"|' "$sddm_directory/theme.conf" 2>&1 | tee -a "$log" || true fi } @@ -192,9 +195,12 @@ apply_sddm_12h_format_sequoia() { local log="$2" if [ -d "$sddm_directory" ]; then echo "${YELLOW}sddm sequoia_2${RESET} theme exists. Editing to 12H format" 2>&1 | tee -a "$log" - sudo sed -i 's|^clockFormat=\"HH:mm\"|## clockFormat=\"HH:mm\"|' "$sddm_directory/theme.conf" 2>&1 | tee -a "$log" || true - if ! grep -q 'clockFormat=\"hh:mm AP\"' "$sddm_directory/theme.conf"; then - sudo sed -i '/^clockFormat=/a clockFormat=\"hh:mm AP\"' "$sddm_directory/theme.conf" 2>&1 | tee -a "$log" || true + if ! sudo -n sed -i 's|^clockFormat="HH:mm"|## clockFormat="HH:mm"|' "$sddm_directory/theme.conf" 2>&1 | tee -a "$log"; then + echo "${WARN:-[WARN]} Skipping sequoia SDDM 12H edit (sudo password required)." 2>&1 | tee -a "$log" + return + fi + if ! grep -q 'clockFormat="hh:mm AP"' "$sddm_directory/theme.conf"; then + sudo -n sed -i '/^clockFormat=/a clockFormat="hh:mm AP"' "$sddm_directory/theme.conf" 2>&1 | tee -a "$log" || true fi echo "${OK} 12H format set to SDDM successfully." 2>&1 | tee -a "$log" fi -- cgit v1.2.3 From d10333068edefd57a354332c3d32cb8ae3fb81b2 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sun, 11 Jan 2026 02:53:39 -0500 Subject: Got caught in sudo/sddm loop --- scripts/lib_prompts.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts/lib_prompts.sh') diff --git a/scripts/lib_prompts.sh b/scripts/lib_prompts.sh index dcad7682..c79c9da6 100644 --- a/scripts/lib_prompts.sh +++ b/scripts/lib_prompts.sh @@ -162,10 +162,13 @@ prompt_clock_12h() { echo "${WARN} hyprlock template not found; skipping 12H lock format edits" 2>&1 | tee -a "$log" fi - # SDDM themes - apply_sddm_12h_format "/usr/share/sddm/themes/simple-sddm" "$log" - apply_sddm_12h_format "/usr/share/sddm/themes/simple_sddm_2" "$log" - apply_sddm_12h_format_sequoia "/usr/share/sddm/themes/sequoia_2" "$log" + if [ "${EXPRESS_MODE:-0}" -eq 0 ]; then + apply_sddm_12h_format "/usr/share/sddm/themes/simple-sddm" "$log" + apply_sddm_12h_format "/usr/share/sddm/themes/simple_sddm_2" "$log" + apply_sddm_12h_format_sequoia "/usr/share/sddm/themes/sequoia_2" "$log" + else + echo "${NOTE:-[NOTE]} Express mode: skipping SDDM 12H edits to avoid sudo prompts." 2>&1 | tee -a "$log" + fi echo "${OK} 12H format set on waybar clocks succesfully." 2>&1 | tee -a "$log" return elif [[ "$answer" == "n" ]]; then -- cgit v1.2.3 From 3392c883f24c62e011775fa41c2cfc93086bfd7d Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sun, 11 Jan 2026 02:59:35 -0500 Subject: Still working on prompts code On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: scripts/lib_prompts.sh --- scripts/lib_prompts.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'scripts/lib_prompts.sh') diff --git a/scripts/lib_prompts.sh b/scripts/lib_prompts.sh index c79c9da6..a63afde3 100644 --- a/scripts/lib_prompts.sh +++ b/scripts/lib_prompts.sh @@ -214,8 +214,11 @@ prompt_rainbow_borders() { local log="$1" echo "${NOTE} ${SKY_BLUE}By default, Rainbow Borders animation is enabled" echo "${WARN} However, this uses a bit more CPU and Memory resources." - echo -n "${CAT} Do you want to disable Rainbow Borders animation? (y/N): " - read border_choice + if ! read -r -p "${CAT} Do you want to disable Rainbow Borders animation? (y/N): " border_choice &1 | tee -a "$log" + echo "kept" + return + fi if [[ "$border_choice" =~ ^[Yy]$ ]]; then mv config/hypr/UserScripts/RainbowBorders.sh config/hypr/UserScripts/RainbowBorders.bak.sh sed -i '/exec-once = \$UserScripts\/RainbowBorders.sh/s/^/#/' config/hypr/configs/Startup_Apps.conf @@ -243,8 +246,10 @@ prompt_express_upgrade() { else while true; do echo "${NOTE} Express mode skips config restore prompts, SDDM/background questions, and trims old backups." - echo -n "${CAT} Do you want to continue with EXPRESS upgrade mode? (y/N): " - read express_choice + if ! read -r -p "${CAT} Do you want to continue with EXPRESS upgrade mode? (y/N): " express_choice &1 | tee -a "$log" + break + fi case "$express_choice" in [Yy]) EXPRESS_MODE=1 -- cgit v1.2.3 From 3363d48f00d92bbefe1a65c5331a5671ef88ae6a Mon Sep 17 00:00:00 2001 From: Don Williams Date: Fri, 16 Jan 2026 22:22:14 -0500 Subject: Disabled RainbowBorders by default use quick settings to enable The new mode select menu for RainbowBorders makes the prompt at install redundant. Especially when upgrading On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: CHANGELOG.md renamed: config/hypr/UserScripts/RainbowBorders.sh -> config/hypr/UserScripts/RainbowBorders.bak.sh modified: config/hypr/configs/Startup_Apps.conf modified: copy.sh modified: scripts/lib_prompts.sh --- CHANGELOG.md | 2 + config/hypr/UserScripts/RainbowBorders.bak.sh | 89 +++++++++++++++++++++++++++ config/hypr/UserScripts/RainbowBorders.sh | 89 --------------------------- config/hypr/configs/Startup_Apps.conf | 4 +- copy.sh | 1 - scripts/lib_prompts.sh | 21 ------- 6 files changed, 93 insertions(+), 113 deletions(-) create mode 100755 config/hypr/UserScripts/RainbowBorders.bak.sh delete mode 100755 config/hypr/UserScripts/RainbowBorders.sh (limited to 'scripts/lib_prompts.sh') diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a9ecb61..8ae7c154 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ - There are now mulitple modes for the Rainbow Borders feature - `Disabled`, `Wallust Color`, `Rainbow`, `Gradient flow` - Thank you for the submission +- Disabled `RainbowBorders.sh` by default +- Use the quick setings menu `SUPERSHIFT + E` to enable, select mode - 2026-01-15 - Created waybar configs for ML4W Glass style diff --git a/config/hypr/UserScripts/RainbowBorders.bak.sh b/config/hypr/UserScripts/RainbowBorders.bak.sh new file mode 100755 index 00000000..67269b8a --- /dev/null +++ b/config/hypr/UserScripts/RainbowBorders.bak.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# Smooth border cycling effect using Wallust palette or full rainbow + +# Possible values: "wallust_random", "rainbow", "gradient_flow" +EFFECT_TYPE="gradient_flow" + +WALLUST_COLORS_SOURCE="$HOME/.config/hypr/wallust/wallust-hyprland.conf" + +WALLUST_COLORS=() + +# ---------- LOAD WALLUST COLORS ---------- +if [[ "$EFFECT_TYPE" == "wallust_random" || "$EFFECT_TYPE" == "gradient_flow" ]]; then + # Accept either hex (0xffRRGGBB) or rgb(r,g,b) and normalize to 0xffRRGGBB + mapfile -t WALLUST_COLORS < <( + grep -E '^\$color[0-9]+' "$WALLUST_COLORS_SOURCE" | awk ' + function hex2(s){ return (length(s)==6 ? "0xff"s : ""); } + function rgb2(r,g,b){ return sprintf("0xff%02x%02x%02x", r, g, b); } + { + if (match($0, /0x([0-9a-fA-F]{8})/, m)) { print "0x" m[1]; next } + if (match($0, /#([0-9a-fA-F]{6})/, m)) { print hex2(m[1]); next } + if (match($0, /rgb\(([0-9]+),[ ]*([0-9]+),[ ]*([0-9]+)\)/, m)) { + print rgb2(m[1], m[2], m[3]); next + } + }' + ) + + if (( ${#WALLUST_COLORS[@]} == 0 )); then + # If wallust colors can't be loaded, fall back to random_hex + EFFECT_TYPE="rainbow" + fi +fi + +# ---------- RANDOM WALLUST COLORS ---------- +function wallust_random() { + echo "${WALLUST_COLORS[RANDOM % ${#WALLUST_COLORS[@]}]}" +} + +# ---------- RAINBOW COLORS ---------- +function random_hex() { + echo "0xff$(openssl rand -hex 3)" +} + +# ---------- FLOW MODE ---------- +BASE_COLOR="${WALLUST_COLORS[10]}" +GRAD1_COLOR="${WALLUST_COLORS[14]}" +GRAD2_COLOR="${WALLUST_COLORS[13]}" +GLOW_COLOR="${WALLUST_COLORS[15]}" + +MAX_POS=10 +GLOW_POS=0 + +function gradient_flow_color() { + local pos=$1 + local d=$(( pos - GLOW_POS )) + + # wrap distance (-9..9) + if (( d > MAX_POS/2 )); then d=$((d - MAX_POS)); fi + if (( d < -MAX_POS/2 )); then d=$((d + MAX_POS)); fi + + case "${d#-}" in + 0) echo "$GLOW_COLOR" ;; + 1) echo "$GRAD1_COLOR" ;; + 2) echo "$GRAD2_COLOR" ;; + *) echo "$BASE_COLOR" ;; + esac + + if (( pos == MAX_POS - 1 )); then + GLOW_POS=$(( (GLOW_POS + 1) % MAX_POS )) + fi +} + +# ---------- Main function ---------- + +function get_color() { + if [[ "$EFFECT_TYPE" == "wallust_random" && ${#WALLUST_COLORS[@]} -gt 0 ]]; then + wallust_random + elif [[ "$EFFECT_TYPE" == "gradient_flow" && ${#WALLUST_COLORS[@]} -ge 16 ]]; then + gradient_flow_color "$1" + else + random_hex + fi +} + +# border effect for ACTIVE window +hyprctl keyword general:col.active_border $(get_color 0) $(get_color 1) $(get_color 2) $(get_color 3) $(get_color 4) $(get_color 5) $(get_color 6) $(get_color 7) $(get_color 8) $(get_color 9) 270deg + +# border effect for INACTIVE windows +#hyprctl keyword general:col.inactive_border $(get_color 0) $(get_color 1) $(get_color 2) $(get_color 3) $(get_color 4) $(get_color 5) $(get_color 6) $(get_color 7) $(get_color 8) $(get_color 9) 270deg \ No newline at end of file diff --git a/config/hypr/UserScripts/RainbowBorders.sh b/config/hypr/UserScripts/RainbowBorders.sh deleted file mode 100755 index 67269b8a..00000000 --- a/config/hypr/UserScripts/RainbowBorders.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## -# Smooth border cycling effect using Wallust palette or full rainbow - -# Possible values: "wallust_random", "rainbow", "gradient_flow" -EFFECT_TYPE="gradient_flow" - -WALLUST_COLORS_SOURCE="$HOME/.config/hypr/wallust/wallust-hyprland.conf" - -WALLUST_COLORS=() - -# ---------- LOAD WALLUST COLORS ---------- -if [[ "$EFFECT_TYPE" == "wallust_random" || "$EFFECT_TYPE" == "gradient_flow" ]]; then - # Accept either hex (0xffRRGGBB) or rgb(r,g,b) and normalize to 0xffRRGGBB - mapfile -t WALLUST_COLORS < <( - grep -E '^\$color[0-9]+' "$WALLUST_COLORS_SOURCE" | awk ' - function hex2(s){ return (length(s)==6 ? "0xff"s : ""); } - function rgb2(r,g,b){ return sprintf("0xff%02x%02x%02x", r, g, b); } - { - if (match($0, /0x([0-9a-fA-F]{8})/, m)) { print "0x" m[1]; next } - if (match($0, /#([0-9a-fA-F]{6})/, m)) { print hex2(m[1]); next } - if (match($0, /rgb\(([0-9]+),[ ]*([0-9]+),[ ]*([0-9]+)\)/, m)) { - print rgb2(m[1], m[2], m[3]); next - } - }' - ) - - if (( ${#WALLUST_COLORS[@]} == 0 )); then - # If wallust colors can't be loaded, fall back to random_hex - EFFECT_TYPE="rainbow" - fi -fi - -# ---------- RANDOM WALLUST COLORS ---------- -function wallust_random() { - echo "${WALLUST_COLORS[RANDOM % ${#WALLUST_COLORS[@]}]}" -} - -# ---------- RAINBOW COLORS ---------- -function random_hex() { - echo "0xff$(openssl rand -hex 3)" -} - -# ---------- FLOW MODE ---------- -BASE_COLOR="${WALLUST_COLORS[10]}" -GRAD1_COLOR="${WALLUST_COLORS[14]}" -GRAD2_COLOR="${WALLUST_COLORS[13]}" -GLOW_COLOR="${WALLUST_COLORS[15]}" - -MAX_POS=10 -GLOW_POS=0 - -function gradient_flow_color() { - local pos=$1 - local d=$(( pos - GLOW_POS )) - - # wrap distance (-9..9) - if (( d > MAX_POS/2 )); then d=$((d - MAX_POS)); fi - if (( d < -MAX_POS/2 )); then d=$((d + MAX_POS)); fi - - case "${d#-}" in - 0) echo "$GLOW_COLOR" ;; - 1) echo "$GRAD1_COLOR" ;; - 2) echo "$GRAD2_COLOR" ;; - *) echo "$BASE_COLOR" ;; - esac - - if (( pos == MAX_POS - 1 )); then - GLOW_POS=$(( (GLOW_POS + 1) % MAX_POS )) - fi -} - -# ---------- Main function ---------- - -function get_color() { - if [[ "$EFFECT_TYPE" == "wallust_random" && ${#WALLUST_COLORS[@]} -gt 0 ]]; then - wallust_random - elif [[ "$EFFECT_TYPE" == "gradient_flow" && ${#WALLUST_COLORS[@]} -ge 16 ]]; then - gradient_flow_color "$1" - else - random_hex - fi -} - -# border effect for ACTIVE window -hyprctl keyword general:col.active_border $(get_color 0) $(get_color 1) $(get_color 2) $(get_color 3) $(get_color 4) $(get_color 5) $(get_color 6) $(get_color 7) $(get_color 8) $(get_color 9) 270deg - -# border effect for INACTIVE windows -#hyprctl keyword general:col.inactive_border $(get_color 0) $(get_color 1) $(get_color 2) $(get_color 3) $(get_color 4) $(get_color 5) $(get_color 6) $(get_color 7) $(get_color 8) $(get_color 9) 270deg \ No newline at end of file diff --git a/config/hypr/configs/Startup_Apps.conf b/config/hypr/configs/Startup_Apps.conf index 2bf902cd..0cc5da11 100644 --- a/config/hypr/configs/Startup_Apps.conf +++ b/config/hypr/configs/Startup_Apps.conf @@ -33,8 +33,8 @@ exec-once = $scriptsDir/Hyprsunset.sh init exec-once = wl-paste --type text --watch cliphist store exec-once = wl-paste --type image --watch cliphist store -# Rainbow borders -exec-once = $UserScripts/RainbowBorders.sh +# Rainbow borders (disabled by default; use quick settings menu) +#exec-once = $UserScripts/RainbowBorders.sh # Here are list of features available but disabled by default diff --git a/copy.sh b/copy.sh index 31c66a0b..b061f4ac 100755 --- a/copy.sh +++ b/copy.sh @@ -355,7 +355,6 @@ fi printf "\n%.0s" {1..1} prompt_clock_12h "$LOG" printf "\n%.0s" {1..1} -prompt_rainbow_borders "$LOG" >/dev/null printf "\n%.0s" {1..1} prompt_express_upgrade "$EXPRESS_SUPPORTED" "$LOG" diff --git a/scripts/lib_prompts.sh b/scripts/lib_prompts.sh index a63afde3..bf6fafd7 100644 --- a/scripts/lib_prompts.sh +++ b/scripts/lib_prompts.sh @@ -209,27 +209,6 @@ apply_sddm_12h_format_sequoia() { fi } -# Rainbow borders toggle; returns "disabled" or "kept". -prompt_rainbow_borders() { - local log="$1" - echo "${NOTE} ${SKY_BLUE}By default, Rainbow Borders animation is enabled" - echo "${WARN} However, this uses a bit more CPU and Memory resources." - if ! read -r -p "${CAT} Do you want to disable Rainbow Borders animation? (y/N): " border_choice &1 | tee -a "$log" - echo "kept" - return - fi - if [[ "$border_choice" =~ ^[Yy]$ ]]; then - mv config/hypr/UserScripts/RainbowBorders.sh config/hypr/UserScripts/RainbowBorders.bak.sh - sed -i '/exec-once = \$UserScripts\/RainbowBorders.sh/s/^/#/' config/hypr/configs/Startup_Apps.conf - sed -i '/^[[:space:]]*animation = borderangle, 1, 180, liner, loop/s/^/#/' config/hypr/configs/UserAnimations.conf - echo "${OK} Rainbow borders are now disabled." 2>&1 | tee -a "$log" - echo "disabled" - else - echo "${NOTE} No changes made. Rainbow borders remain enabled." 2>&1 | tee -a "$log" - echo "kept" - fi -} # Express upgrade confirmation; may set EXPRESS_MODE=1. prompt_express_upgrade() { -- cgit v1.2.3