From 2bbe867a07895b5bfdd00722830324fb1b37cf11 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 1 Jan 2024 18:43:31 +0900 Subject: Just a small tinkering... :) --- config/hypr/UserScripts/WallpaperRandom.sh | 57 +++++++++++++----------------- 1 file changed, 24 insertions(+), 33 deletions(-) (limited to 'config/hypr/UserScripts/WallpaperRandom.sh') diff --git a/config/hypr/UserScripts/WallpaperRandom.sh b/config/hypr/UserScripts/WallpaperRandom.sh index 13bd2995..f8cc54f9 100755 --- a/config/hypr/UserScripts/WallpaperRandom.sh +++ b/config/hypr/UserScripts/WallpaperRandom.sh @@ -1,35 +1,26 @@ #!/bin/bash +## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# Script for Random Wallpaper ( CTRL ALT W) + +wallDIR="$HOME/Pictures/wallpapers" +scriptsDir="$HOME/.config/hypr/scripts" + +PICS=($(find ${wallDIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \))) +RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]} + + +# Transition config +FPS=60 +TYPE="random" +DURATION=1 +BEZIER=".43,1.19,1,.4" +SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" + + +swww query || swww init && swww img ${RANDOMPICS} $SWWW_PARAMS + + +${scriptsDir}/PywalSwww.sh +sleep 1 +${scriptsDir}/Refresh.sh -# This script will randomly go through the files of a directory, setting it -# up as the wallpaper at regular intervals -# -# NOTE: this script uses bash (not POSIX shell) for the RANDOM variable - -pywal_refresh=$HOME/.config/hypr/scripts/RefreshNoWaybar.sh - -if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then - echo "Usage: - $0 " - exit 1 -fi - -# Edit below to control the images transition -export SWWW_TRANSITION_FPS=60 -export SWWW_TRANSITION_TYPE=simple - -# This controls (in seconds) when to switch to the next image -INTERVAL=1800 - -while true; do - find "$1" \ - | while read -r img; do - echo "$((RANDOM % 1000)):$img" - done \ - | sort -n | cut -d':' -f2- \ - | while read -r img; do - swww img "$img" - $pywal_refresh - sleep $INTERVAL - - done -done -- cgit v1.2.3