aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/UserScripts/WallpaperRandom.sh
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-03-30 21:58:55 -0700
committerPinapelz <yukais@pinapelz.com>2026-03-30 21:58:55 -0700
commit4acf85db722ebe7e019e7427436083b3b9f4959e (patch)
tree6d5b416ad605730a6d573d1b4178c7676dc8a015 /config/hypr/UserScripts/WallpaperRandom.sh
parent89e10cd0c0331fc727889d41e34309db1fb5735f (diff)
parente4b9059d346e6a6dbd6216cd1fb5e41085bb6e7b (diff)
Merge remote-tracking branch 'upstream/main'
Diffstat (limited to 'config/hypr/UserScripts/WallpaperRandom.sh')
-rwxr-xr-xconfig/hypr/UserScripts/WallpaperRandom.sh25
1 files changed, 19 insertions, 6 deletions
diff --git a/config/hypr/UserScripts/WallpaperRandom.sh b/config/hypr/UserScripts/WallpaperRandom.sh
index a9908e19..db8251f2 100755
--- a/config/hypr/UserScripts/WallpaperRandom.sh
+++ b/config/hypr/UserScripts/WallpaperRandom.sh
@@ -1,10 +1,17 @@
#!/usr/bin/env bash
-# /* ---- 💫 https://github.com/LinuxBeginnings 💫 ---- */ ##
+# ==================================================
+# KoolDots (2026)
+# Project URL: https://github.com/LinuxBeginnings
+# License: GNU GPLv3
+# SPDX-License-Identifier: GPL-3.0-or-later
+# ==================================================
# Script for Random Wallpaper ( CTRL ALT W)
PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")"
wallDIR="$PICTURES_DIR/wallpapers"
SCRIPTSDIR="$HOME/.config/hypr/scripts"
+# shellcheck source=/dev/null
+. "$SCRIPTSDIR/WallpaperCmd.sh"
focused_monitor=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name')
@@ -12,18 +19,24 @@ PICS=($(find -L "${wallDIR}" -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name
RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]}
-# Transition config
+# Transition config (only when using swww)
FPS=30
TYPE="random"
DURATION=1
BEZIER=".43,1.19,1,.4"
-SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER"
+if [[ "$WWW_CMD" == "swww" ]]; then
+ SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER"
+else
+ SWWW_PARAMS=""
+fi
+if ! "$WWW_CMD" query >/dev/null 2>&1; then
+ "$WWW_DAEMON" "${WWW_DAEMON_ARGS[@]}" &
+fi
-
-swww query || swww-daemon --format xrgb && swww img -o $focused_monitor ${RANDOMPICS} $SWWW_PARAMS
+"$WWW_CMD" img -o "$focused_monitor" "$RANDOMPICS" $SWWW_PARAMS
wait $!
-"$SCRIPTSDIR/WallustSwww.sh" &&
+"$SCRIPTSDIR/WallustSwww.sh" "$RANDOMPICS" &&
wait $!
sleep 2
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage