aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/UserScripts/RainbowBorders.bak.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/hypr/UserScripts/RainbowBorders.bak.sh')
-rwxr-xr-xconfig/hypr/UserScripts/RainbowBorders.bak.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/config/hypr/UserScripts/RainbowBorders.bak.sh b/config/hypr/UserScripts/RainbowBorders.bak.sh
index 82807919..528bb455 100755
--- a/config/hypr/UserScripts/RainbowBorders.bak.sh
+++ b/config/hypr/UserScripts/RainbowBorders.bak.sh
@@ -46,6 +46,10 @@ fi
# ---------- RANDOM WALLUST COLORS ----------
function wallust_random() {
+ if ((${#WALLUST_COLORS[@]} == 0)); then
+ random_hex
+ return
+ fi
echo "${WALLUST_COLORS[RANDOM % ${#WALLUST_COLORS[@]}]}"
}
@@ -61,7 +65,11 @@ function random_hex() {
echo "${RAINBOW_PALETTE[RANDOM % ${#RAINBOW_PALETTE[@]}]}"
return
fi
- echo "0xff$(openssl rand -hex 3)"
+ if command -v openssl >/dev/null 2>&1; then
+ echo "0xff$(openssl rand -hex 3)"
+ else
+ printf '0xff%02x%02x%02x\n' $((RANDOM % 256)) $((RANDOM % 256)) $((RANDOM % 256))
+ fi
}
function rainbow_color() {
local idx="${1:-0}"
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage