From 2307f03405f6b7f8695f190089d24a6c29dab09f Mon Sep 17 00:00:00 2001 From: Maximilian Zhu Date: Mon, 29 Dec 2025 12:51:57 +0100 Subject: Update: Enhance Weather.sh to get city from IP address Added functionality to retrieve current city based on IP address with fallbacks and manual setting. --- config/hypr/UserScripts/Weather.sh | 48 ++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 7 deletions(-) (limited to 'config/hypr/UserScripts') diff --git a/config/hypr/UserScripts/Weather.sh b/config/hypr/UserScripts/Weather.sh index ac9abc13..4588ed1d 100755 --- a/config/hypr/UserScripts/Weather.sh +++ b/config/hypr/UserScripts/Weather.sh @@ -2,16 +2,50 @@ # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # weather info from wttr. https://github.com/chubin/wttr.in # Remember to add city +# Function to get current city from IP address with fallback + +# Get your current location with your IP adress +get_current_city() { + local city + + # First try: ipinfo.io + local location_data=$(curl -fsS "https://ipinfo.io/json" 2>/dev/null) + if [ $? -eq 0 ] && [ -n "$location_data" ]; then + city=$(echo "$location_data" | grep -o '"city"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4) + if [ -n "$city" ]; then + echo "$city" + return 0 + fi + fi + + # Fallback: ipapi.co + city=$(curl -fsS "https://ipapi.co/json" 2>/dev/null | grep -o '"city"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4) + if [ -n "$city" ]; then + echo "$city" + return 0 + fi + + # Last resort: ipwho.is + city=$(curl -fsS "https://ipwho.is/" 2>/dev/null | grep -o '"city"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d'"' -f4) + if [ -n "$city" ]; then + echo "$city" + return 0 + fi + + # If all fail + echo "Unknown" >&2 + return 1 +} -city="" - +city=$(get_current_city) -# if city is blank, use https://ipapi.co/json to get location from IP -if [ -z "$city" ]; then - city=$(curl -fsS https://ipapi.co/json | grep city | cut -f4 -d'"') +# If city is empty, that means the IP check failed, which means, we should use manual setting +if [ -z "$city" ] || [ "$city" = "Unknown" ]; then + # SET YOUR MANUAL CITY HERE + city=" " # ← Change this to your preferred city + echo "Using manual city: $city" >&2 fi - # URL-encode city for safe use in URLs encoded_city="$city" if command -v python3 >/dev/null 2>&1; then @@ -206,4 +240,4 @@ tooltip_json=$(json_escape "${weather[0]}: $temperature $cond_disp") printf '{"text":"%s", "alt":"%s", "tooltip":"%s"}\n' "$text_json" "$alt_json" "$tooltip_json" # Write a two-line cache with an actual newline between lines -printf ' %s \n%s %s\n' "$temperature" "$condition" "${weather[1]}" > "$HOME/.cache/.weather_cache" \ No newline at end of file +printf ' %s \n%s %s\n' "$temperature" "$condition" "${weather[1]}" > "$HOME/.cache/.weather_cache" -- cgit v1.2.3 From 59713a66e3dce8b2c006dc1ce7847b761d759147 Mon Sep 17 00:00:00 2001 From: Maximilian Zhu Date: Mon, 29 Dec 2025 13:02:07 +0100 Subject: Add network check to WeatherWrap script Added a network connectivity check function to determine if the script can proceed with fetching weather data. If no network is available, it returns an offline status. (It will show an offline Icon in Waybar after waking up from `systemctl suspend` or `systemctl hibernate` and having no network. If you click it in waybar it will recheck, but this is unintended) --- config/hypr/UserScripts/WeatherWrap.sh | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'config/hypr/UserScripts') diff --git a/config/hypr/UserScripts/WeatherWrap.sh b/config/hypr/UserScripts/WeatherWrap.sh index 10c125dc..5b266930 100755 --- a/config/hypr/UserScripts/WeatherWrap.sh +++ b/config/hypr/UserScripts/WeatherWrap.sh @@ -6,6 +6,30 @@ SCRIPT_DIR="$(dirname "$0")" PY_SCRIPT="$SCRIPT_DIR/Weather.py" BASH_FALLBACK="$SCRIPT_DIR/Weather.sh" +# Function to check network connectivity +check_network() { + # Try multiple methods to check network + if ping -c1 -W2 8.8.8.8 >/dev/null 2>&1; then + return 0 + fi + + if ping -c1 -W2 1.1.1.1 >/dev/null 2>&1; then + return 0 + fi + + if curl -s --connect-timeout 3 "https://ipinfo.io" >/dev/null 2>&1; then + return 0 + fi + + return 1 +} + +# If no network, return offline status immediately +if ! check_network; then + echo '{"text":"󰖪", "alt":"Offline", "tooltip":"No network connection"}' + exit 0 +fi + run_fallback() { if [ -f "$BASH_FALLBACK" ]; then # Invoke via bash to avoid requiring +x and ensure consistent shell @@ -30,4 +54,4 @@ else echo "python3 not found in PATH — falling back to Weather.sh" >&2 run_fallback "$@" exit $? -fi \ No newline at end of file +fi -- cgit v1.2.3 From d05f22e5f4e92827ea69911cdd3dfc83c64c655c Mon Sep 17 00:00:00 2001 From: Jaël Champagne Gareau Date: Tue, 30 Dec 2025 22:06:25 -0500 Subject: fix: respect XDG dir instead of forcing ~/Pictures (#899) * fix: respect XDG dir instead of forcing ~/Pictures * fix: make xdg-user-dir usage more robust --------- Co-authored-by: Donald Williams <129223418+dwilliam62@users.noreply.github.com> --- config/hypr/UserScripts/WallpaperRandom.sh | 5 +++-- config/hypr/UserScripts/WallpaperSelect.sh | 3 ++- config/hypr/configs/Startup_Apps.conf | 4 ++-- config/hypr/scripts/DarkLight.sh | 3 ++- config/hypr/scripts/ScreenShot.sh | 3 ++- config/hypr/scripts/sddm_wallpaper.sh | 3 ++- config/swappy/config | 2 +- copy.sh | 11 ++++++----- 8 files changed, 20 insertions(+), 14 deletions(-) (limited to 'config/hypr/UserScripts') diff --git a/config/hypr/UserScripts/WallpaperRandom.sh b/config/hypr/UserScripts/WallpaperRandom.sh index 654d4bd3..8dd680d5 100755 --- a/config/hypr/UserScripts/WallpaperRandom.sh +++ b/config/hypr/UserScripts/WallpaperRandom.sh @@ -2,12 +2,13 @@ # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # Script for Random Wallpaper ( CTRL ALT W) -wallDIR="$HOME/Pictures/wallpapers" +PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")" +wallDIR="$PICTURES_DIR/wallpapers" SCRIPTSDIR="$HOME/.config/hypr/scripts" focused_monitor=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name') -PICS=($(find -L ${wallDIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.pnm" -o -name "*.tga" -o -name "*.tiff" -o -name "*.webp" -o -name "*.bmp" -o -name "*.farbfeld" -o -name "*.gif" \))) +PICS=($(find -L "${wallDIR}" -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.pnm" -o -name "*.tga" -o -name "*.tiff" -o -name "*.webp" -o -name "*.bmp" -o -name "*.farbfeld" -o -name "*.gif" \))) RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]} diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh index 0029d3e5..3fd3b858 100755 --- a/config/hypr/UserScripts/WallpaperSelect.sh +++ b/config/hypr/UserScripts/WallpaperSelect.sh @@ -4,7 +4,8 @@ # WALLPAPERS PATH terminal=kitty -wallDIR="$HOME/Pictures/wallpapers" +PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")" +wallDIR="$PICTURES_DIR/wallpapers" SCRIPTSDIR="$HOME/.config/hypr/scripts" wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current" diff --git a/config/hypr/configs/Startup_Apps.conf b/config/hypr/configs/Startup_Apps.conf index 27c8d26a..550c79d4 100644 --- a/config/hypr/configs/Startup_Apps.conf +++ b/config/hypr/configs/Startup_Apps.conf @@ -4,7 +4,7 @@ $scriptsDir = $HOME/.config/hypr/scripts $UserScripts = $HOME/.config/hypr/UserScripts -$wallDIR=$HOME/Pictures/wallpapers +$wallDIR = $HOME/Pictures/wallpapers # change path manually here if needed $lock = $scriptsDir/LockScreen.sh $SwwwRandom = $UserScripts/WallpaperAutoChange.sh $livewallpaper="" @@ -53,7 +53,7 @@ exec-once = $scriptsDir/Hyprsunset.sh init # Here are list of features available but disabled by default # Persistent wallpaper -# exec-once = swww-daemon --format xrgb && swww img $HOME/Pictures/wallpapers/mecha-nostalgia.png +# exec-once = swww-daemon --format xrgb && swww img $wallDIR/mecha-nostalgia.png # Gnome polkit for NixOS #exec-once = $scriptsDir/Polkit-NixOS.sh diff --git a/config/hypr/scripts/DarkLight.sh b/config/hypr/scripts/DarkLight.sh index e473efb2..a225c7bc 100755 --- a/config/hypr/scripts/DarkLight.sh +++ b/config/hypr/scripts/DarkLight.sh @@ -4,7 +4,8 @@ # Note: Scripts are looking for keywords Light or Dark except for wallpapers as the are in a separate directories # Paths -wallpaper_base_path="$HOME/Pictures/wallpapers/Dynamic-Wallpapers" +PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")" +wallpaper_base_path="$PICTURES_DIR/wallpapers/Dynamic-Wallpapers" dark_wallpapers="$wallpaper_base_path/Dark" light_wallpapers="$wallpaper_base_path/Light" hypr_config_path="$HOME/.config/hypr" diff --git a/config/hypr/scripts/ScreenShot.sh b/config/hypr/scripts/ScreenShot.sh index 0ef70964..3d578a51 100755 --- a/config/hypr/scripts/ScreenShot.sh +++ b/config/hypr/scripts/ScreenShot.sh @@ -4,7 +4,8 @@ # variables time=$(date "+%d-%b_%H-%M-%S") -dir="$(xdg-user-dir PICTURES)/Screenshots" +PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")" +dir="$PICTURES_DIR/Screenshots" file="Screenshot_${time}_${RANDOM}.png" iDIR="$HOME/.config/swaync/icons" diff --git a/config/hypr/scripts/sddm_wallpaper.sh b/config/hypr/scripts/sddm_wallpaper.sh index 9dca2f72..5ebab44c 100755 --- a/config/hypr/scripts/sddm_wallpaper.sh +++ b/config/hypr/scripts/sddm_wallpaper.sh @@ -6,7 +6,8 @@ # variables terminal=kitty -wallDIR="$HOME/Pictures/wallpapers" +PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")" +wallDIR="$PICTURES_DIR/wallpapers" SCRIPTSDIR="$HOME/.config/hypr/scripts" wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current" wallpaper_modified="$HOME/.config/hypr/wallpaper_effects/.wallpaper_modified" diff --git a/config/swappy/config b/config/swappy/config index 45d84e49..ea04ccc2 100644 --- a/config/swappy/config +++ b/config/swappy/config @@ -1,5 +1,5 @@ [Default] -save_dir=$HOME/Pictures/Screenshots +save_dir=$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")/Screenshots save_filename_format=swappy-%Y%m%d-%H%M%S.png show_pannel=false line_size=5 diff --git a/copy.sh b/copy.sh index 5b3d17cd..e925a698 100755 --- a/copy.sh +++ b/copy.sh @@ -1087,8 +1087,9 @@ fi printf "\n%.0s" {1..1} # wallpaper stuff -mkdir -p $HOME/Pictures/wallpapers -if cp -r wallpapers $HOME/Pictures/; then +PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")" +mkdir -p "$PICTURES_DIR/wallpapers" +if cp -r wallpapers "$PICTURES_DIR/"; then echo "${OK} Some ${MAGENTA}wallpapers${RESET} copied successfully!" | tee -a "$LOG" else echo "${ERROR} Failed to copy some ${YELLOW}wallpapers${RESET}" | tee -a "$LOG" @@ -1168,12 +1169,12 @@ while true; do echo "${OK} Wallpapers downloaded successfully." 2>&1 | tee -a "$LOG" # Check if wallpapers directory exists and create it if not - if [ ! -d "$HOME/Pictures/wallpapers" ]; then - mkdir -p "$HOME/Pictures/wallpapers" + if [ ! -d "$PICTURES_DIR/wallpapers" ]; then + mkdir -p "$PICTURES_DIR/wallpapers" echo "${OK} Created wallpapers directory." 2>&1 | tee -a "$LOG" fi - if cp -R Wallpaper-Bank/wallpapers/* "$HOME/Pictures/wallpapers/" >>"$LOG" 2>&1; then + if cp -R Wallpaper-Bank/wallpapers/* "$PICTURES_DIR/wallpapers/" >>"$LOG" 2>&1; then echo "${OK} Wallpapers copied successfully." 2>&1 | tee -a "$LOG" rm -rf Wallpaper-Bank 2>&1 # Remove cloned repository after copying wallpapers break -- cgit v1.2.3 From 8c70ac492c3058fce029ffa9a31cdb9556a40bcc Mon Sep 17 00:00:00 2001 From: Don Williams Date: Fri, 16 Jan 2026 19:42:32 -0500 Subject: Added submeu for RainbowBorders and the new modes - Added `Rainbow Borders sub memu` - Code provided by [brunoorsolon](https://github.com/brunoorsolon) - There are now mulitple modes for the Rainbow Borders feature - `Disabled`, `Wallust Color`, `Rainbow`, `Gradient flow` - Thank you for the submission On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: CHANGELOG.md modified: config/hypr/UserScripts/RainbowBorders.sh modified: config/hypr/scripts/Kool_Quick_Settings.sh --- CHANGELOG.md | 20 ++++--- config/hypr/UserScripts/RainbowBorders.sh | 92 +++++++++++++++++++++++++++--- config/hypr/scripts/Kool_Quick_Settings.sh | 74 +++++++++++++++++++++++- 3 files changed, 170 insertions(+), 16 deletions(-) (limited to 'config/hypr/UserScripts') diff --git a/CHANGELOG.md b/CHANGELOG.md index e22cb1be..9a9ecb61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,14 +2,20 @@ ## v2.3.19 -- 2026-01-15 - - Created waybar configs for ML4W Glass style - - `TOP & Bottom Summit - glass` - - `Default Laptop - Glass` - - `Everforest - Glass` - - Fixed menu for express-update - - Fixed `Toggle Rainbow` checked for wrong file +- 2026-01-16 +- Added `Rainbow Borders sub memu` + - Code provided by [brunoorsolon](https://github.com/brunoorsolon) + - There are now mulitple modes for the Rainbow Borders feature + - `Disabled`, `Wallust Color`, `Rainbow`, `Gradient flow` + - Thank you for the submission +- 2026-01-15 +- Created waybar configs for ML4W Glass style +- `TOP & Bottom Summit - glass` +- `Default Laptop - Glass` +- `Everforest - Glass` +- Fixed menu for express-update +- Fixed `Toggle Rainbow` checked for wrong file - 2026-01-13 - Added `Toggle Rainbow borders` option to settings menu diff --git a/config/hypr/UserScripts/RainbowBorders.sh b/config/hypr/UserScripts/RainbowBorders.sh index 0a7fd721..7a392ffe 100755 --- a/config/hypr/UserScripts/RainbowBorders.sh +++ b/config/hypr/UserScripts/RainbowBorders.sh @@ -1,14 +1,92 @@ #!/usr/bin/env bash # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## -# for rainbow borders animation +# 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 [[ "$EFFECT_TYPE" == "wallust_random" ]]; then + echo "ERROR: wallust_random enabled but no colors loaded" >&2 + exit 1 + fi + # gradient_flow will fall back to random_hex later + fi +fi + +# ---------- RANDOM WALLUST COLORS ---------- +function wallust_random() { + echo "${WALLUST_COLORS[RANDOM % ${#WALLUST_COLORS[@]}]}" +} + +# ---------- RAINBOW COLORS ---------- function random_hex() { - random_hex=("0xff$(openssl rand -hex 3)") - echo $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 } -# rainbow colors only for active window -hyprctl keyword general:col.active_border $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) 270deg +# 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 -# rainbow colors for inactive window (uncomment to take effect) -#hyprctl keyword general:col.inactive_border $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) 270deg \ No newline at end of file +# 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/scripts/Kool_Quick_Settings.sh b/config/hypr/scripts/Kool_Quick_Settings.sh index c8f71d06..5f0193ed 100755 --- a/config/hypr/scripts/Kool_Quick_Settings.sh +++ b/config/hypr/scripts/Kool_Quick_Settings.sh @@ -74,6 +74,76 @@ toggle_rainbow_borders() { fi } +# Submenu to choose Rainbow Borders mode (disable, wallust_random, rainbow, gradient_flow) +rainbow_borders_menu() { + local rainbow_script="$UserScripts/RainbowBorders.sh" + local disabled_sh_bak="${rainbow_script}.bak" + local disabled_bak_sh="$UserScripts/RainbowBorders.bak.sh" + local refresh_script="$scriptsDir/Refresh.sh" + + # Determine current mode/status + local current="disabled" + if [[ -f "$rainbow_script" ]]; then + current=$(grep -E '^EFFECT_TYPE=' "$rainbow_script" 2>/dev/null | sed -E 's/^EFFECT_TYPE="?([^"]*)"?.*/\1/') + [[ -z "$current" ]] && current="unknown" + fi + + # Build options and prompt + local options="disable\nwallust_random\nrainbow\ngradient_flow" + local choice + choice=$(printf "%b" "$options" | rofi -i -dmenu -config "$rofi_theme" -mesg "Rainbow Borders: choose mode (current: $current)") + + [[ -z "$choice" ]] && return + + case "$choice" in + disable|Disable) + if [[ -f "$rainbow_script" ]]; then + mv "$rainbow_script" "$disabled_sh_bak" + fi + current="disabled" + ;; + wallust_random|rainbow|gradient_flow) + # Ensure script is enabled + if [[ ! -f "$rainbow_script" ]]; then + if [[ -f "$disabled_sh_bak" ]]; then + mv "$disabled_sh_bak" "$rainbow_script" + elif [[ -f "$disabled_bak_sh" ]]; then + mv "$disabled_bak_sh" "$rainbow_script" + else + show_info "RainbowBorders script not found in $UserScripts." + return + fi + fi + + # Update EFFECT_TYPE in place; insert if missing + if grep -q '^EFFECT_TYPE=' "$rainbow_script" 2>/dev/null; then + sed -i 's/^EFFECT_TYPE=.*/EFFECT_TYPE="'"$choice"'"/' "$rainbow_script" + else + if head -n1 "$rainbow_script" | grep -q '^#!'; then + sed -i '1a EFFECT_TYPE="'"$choice"'"' "$rainbow_script" + else + sed -i '1i EFFECT_TYPE="'"$choice"'"' "$rainbow_script" + fi + fi + current="$choice" + ;; + *) + return ;; + esac + + # Run refresh if available + if [[ -x "$refresh_script" ]]; then + "$refresh_script" >/dev/null 2>&1 & + fi + + # Notify + if [[ "$current" == "disabled" ]]; then + show_info "Rainbow Borders disabled." + else + show_info "Rainbow Borders: $current." + fi +} + # Function to display the menu options without numbers menu() { cat < Date: Fri, 16 Jan 2026 20:13:08 -0500 Subject: Changed notification code, trying fix wallust mode On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: config/hypr/UserScripts/RainbowBorders.sh modified: config/hypr/scripts/Kool_Quick_Settings.sh --- config/hypr/UserScripts/RainbowBorders.sh | 7 ++----- config/hypr/scripts/Kool_Quick_Settings.sh | 24 +++++++++++------------- 2 files changed, 13 insertions(+), 18 deletions(-) (limited to 'config/hypr/UserScripts') diff --git a/config/hypr/UserScripts/RainbowBorders.sh b/config/hypr/UserScripts/RainbowBorders.sh index 7a392ffe..67269b8a 100755 --- a/config/hypr/UserScripts/RainbowBorders.sh +++ b/config/hypr/UserScripts/RainbowBorders.sh @@ -26,11 +26,8 @@ if [[ "$EFFECT_TYPE" == "wallust_random" || "$EFFECT_TYPE" == "gradient_flow" ]] ) if (( ${#WALLUST_COLORS[@]} == 0 )); then - if [[ "$EFFECT_TYPE" == "wallust_random" ]]; then - echo "ERROR: wallust_random enabled but no colors loaded" >&2 - exit 1 - fi - # gradient_flow will fall back to random_hex later + # If wallust colors can't be loaded, fall back to random_hex + EFFECT_TYPE="rainbow" fi fi diff --git a/config/hypr/scripts/Kool_Quick_Settings.sh b/config/hypr/scripts/Kool_Quick_Settings.sh index 2a36ea3b..7d9c1a70 100755 --- a/config/hypr/scripts/Kool_Quick_Settings.sh +++ b/config/hypr/scripts/Kool_Quick_Settings.sh @@ -170,19 +170,17 @@ rainbow_borders_menu() { fi # Notify only if changed (friendly display) - if [[ "$current" != "$previous" ]]; then - local new_display="$current" - case "$current" in - wallust_random) new_display="Wallust Color" ;; - rainbow) new_display="Original Rainbow" ;; - gradient_flow) new_display="Gradient Flow" ;; - disabled) new_display="Disabled" ;; - esac - if [[ "$current" == "disabled" ]]; then - show_info "Rainbow Borders disabled." - else - show_info "Rainbow Borders: $new_display." - fi + local new_display="$current" + case "$current" in + wallust_random) new_display="Wallust Color" ;; + rainbow) new_display="Original Rainbow" ;; + gradient_flow) new_display="Gradient Flow" ;; + disabled) new_display="Disabled" ;; + esac + if [[ "$current" == "disabled" ]]; then + show_info "Rainbow Borders disabled." + else + show_info "Rainbow Borders: $new_display." fi } -- 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 'config/hypr/UserScripts') 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 From 5aedcf78f579e7aef6d7309d0b1ea5b4c94f2ca0 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Mon, 19 Jan 2026 07:57:18 -0500 Subject: Changed SDDM wallpaper setting to a dedicated menu item On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: config/hypr/UserScripts/WallpaperEffects.sh modified: config/hypr/UserScripts/WallpaperSelect.sh modified: config/hypr/scripts/Kool_Quick_Settings.sh --- config/hypr/UserScripts/WallpaperEffects.sh | 40 -------------------------- config/hypr/UserScripts/WallpaperSelect.sh | 44 ----------------------------- config/hypr/scripts/Kool_Quick_Settings.sh | 2 ++ 3 files changed, 2 insertions(+), 84 deletions(-) (limited to 'config/hypr/UserScripts') diff --git a/config/hypr/UserScripts/WallpaperEffects.sh b/config/hypr/UserScripts/WallpaperEffects.sh index 89577efa..475969d6 100755 --- a/config/hypr/UserScripts/WallpaperEffects.sh +++ b/config/hypr/UserScripts/WallpaperEffects.sh @@ -106,43 +106,3 @@ fi main sleep 1 - -if [[ -n "$choice" ]]; then - # Resolve SDDM themes directory (standard and NixOS path) - sddm_themes_dir="" - if [ -d "/usr/share/sddm/themes" ]; then - sddm_themes_dir="/usr/share/sddm/themes" - elif [ -d "/run/current-system/sw/share/sddm/themes" ]; then - sddm_themes_dir="/run/current-system/sw/share/sddm/themes" - fi - - if [ -n "$sddm_themes_dir" ]; then - sddm_simple="$sddm_themes_dir/simple_sddm_2" - - # Only prompt if theme exists and its Backgrounds directory is writable - if [ -d "$sddm_simple" ] && [ -w "$sddm_simple/Backgrounds" ]; then - # Check if yad is running to avoid multiple yad notification - if pidof yad > /dev/null; then - killall yad - fi - - if yad --info --text="Set current wallpaper as SDDM background?\n\nNOTE: This only applies to SIMPLE SDDM v2 Theme" \ - --text-align=left \ - --title="SDDM Background" \ - --timeout=5 \ - --timeout-indicator=right \ - --button="yad-yes:0" \ - --button="yad-no:1" \ - ; then - - # Check if terminal exists - if ! command -v "$terminal" &>/dev/null; then - notify-send -i "$iDIR/ja.png" "Missing $terminal" "Install $terminal to enable setting of wallpaper background" - exit 1 - fi - - exec "$SCRIPTSDIR/sddm_wallpaper.sh" --effects - fi - fi - fi -fi diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh index 3fd3b858..316a7cd4 100755 --- a/config/hypr/UserScripts/WallpaperSelect.sh +++ b/config/hypr/UserScripts/WallpaperSelect.sh @@ -99,49 +99,6 @@ menu() { done } -# Offer SDDM Simple Wallpaper Option (only for non-video wallpapers) -set_sddm_wallpaper() { - sleep 1 - - # Resolve SDDM themes directory (standard and NixOS path) - local sddm_themes_dir="" - if [ -d "/usr/share/sddm/themes" ]; then - sddm_themes_dir="/usr/share/sddm/themes" - elif [ -d "/run/current-system/sw/share/sddm/themes" ]; then - sddm_themes_dir="/run/current-system/sw/share/sddm/themes" - fi - - [ -z "$sddm_themes_dir" ] && return 0 - - local sddm_simple="$sddm_themes_dir/simple_sddm_2" - - # Only prompt if theme exists and its Backgrounds directory is writable - if [ -d "$sddm_simple" ] && [ -w "$sddm_simple/Backgrounds" ]; then - - # Check if yad is running to avoid multiple notifications - if pidof yad >/dev/null; then - killall yad - fi - - if yad --info --text="Set current wallpaper as SDDM background?\n\nNOTE: This only applies to SIMPLE SDDM v2 Theme" \ - --text-align=left \ - --title="SDDM Background" \ - --timeout=5 \ - --timeout-indicator=right \ - --button="yes:0" \ - --button="no:1"; then - - # Check if terminal exists - if ! command -v "$terminal" &>/dev/null; then - notify-send -i "$iDIR/error.png" "Missing $terminal" "Install $terminal to enable setting of wallpaper background" - exit 1 - fi - - exec "$SCRIPTSDIR/sddm_wallpaper.sh" --normal - - fi - fi -} modify_startup_config() { local selected_file="$1" @@ -187,7 +144,6 @@ apply_image_wallpaper() { "$SCRIPTSDIR/Refresh.sh" sleep 1 - set_sddm_wallpaper } apply_video_wallpaper() { diff --git a/config/hypr/scripts/Kool_Quick_Settings.sh b/config/hypr/scripts/Kool_Quick_Settings.sh index 2437bd11..0cd58f48 100755 --- a/config/hypr/scripts/Kool_Quick_Settings.sh +++ b/config/hypr/scripts/Kool_Quick_Settings.sh @@ -191,6 +191,7 @@ Edit System Default Startup Apps Edit System Default Window Rules Edit System Default Settings --- UTILITIES --- +Set SDDM Wallpaper Choose Kitty Terminal Theme Configure Monitors (nwg-displays) Configure Workspace Rules (nwg-displays) @@ -226,6 +227,7 @@ main() { "Edit System Default Startup Apps") file="$configs/Startup_Apps.conf" ;; "Edit System Default Window Rules") file="$configs/WindowRules.conf" ;; "Edit System Default Settings") file="$configs/SystemSettings.conf" ;; + "Set SDDM Wallpaper") $scriptsDir/sddm_wallpaper.sh --normal ;; "Choose Kitty Terminal Theme") $scriptsDir/Kitty_themes.sh ;; "Configure Monitors (nwg-displays)") if ! command -v nwg-displays &>/dev/null; then -- cgit v1.2.3