irongit
hygoland/UserScripts/WallpaperRandom.sh
29 lines919 BBourne Again Shell (bash)
1#!/bin/bash
2# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
3# Script for Random Wallpaper ( CTRL ALT W)
4
5wallDIR="$HOME/Pictures/wallpapers"
6SCRIPTSDIR="$HOME/.config/hypr/scripts"
7
8focused_monitor=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name')
9
10PICS=($(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" \)))
11RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]}
12
13
14# Transition config
15FPS=30
16TYPE="random"
17DURATION=1
18BEZIER=".43,1.19,1,.4"
19SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER"
20
21
22swww query || swww-daemon --format xrgb && swww img -o $focused_monitor ${RANDOMPICS} $SWWW_PARAMS
23
24wait $!
25"$SCRIPTSDIR/WallustSwww.sh" &&
26
27wait $!
28sleep 2
29"$SCRIPTSDIR/Refresh.sh"