meow
Some checks failed
ci/woodpecker/push/build-cache Pipeline failed
ci/woodpecker/cron/dependency-pr Pipeline was successful

This commit is contained in:
Lucy Hochkamp 2025-10-16 12:18:36 +02:00
parent 350885960e
commit 33ee2f5760
No known key found for this signature in database
9 changed files with 10909 additions and 45 deletions

View file

@ -62,25 +62,21 @@ in
export SWWW_TRANSITION="fade"
export SWWW_TRANSITION_DURATION="1"
# export SWWW_TRANSITION_STEP="90"
# queue of images to show
images=( $(find $DIR -type f | shuf) )
function get_img() {
item=''${images[0]}
images=("''${images[@]:1}")
if [[ ''${#images[@]} == 0 ]]; then
images=( $(find $DIR -type f | shuf) )
fi
echo $item
}
images=( ) # array of randomized images
while true; do
img=$(get_img)
for d in ''$(swww query | sed -nE 's/^: ([^:]+).*/\1/p'); do # see swww-query(1)
swww img --resize "''$RESIZE_TYPE" --outputs "''$d" "''$img"
if [[ ''${#images[@]} == 0 ]]; then
images=( $(find $DIR -regextype posix-extended -type f -regex '.*\.(jpg|jpeg|gif|png|bmp|dds|exr|ico|tga|tiff|webp)$' | shuf) ) # fill queue if arr empty (rust image crate supported formats)
fi
swww img --resize "''$RESIZE_TYPE" --outputs "''$d" "''${images[0]}" # show first image of arr
images=("''${images[@]:1}") # pop first image of arr
done
sleep "''${DEFAULT_INTERVAL}"
sleep "''${DEFAULT_INTERVAL}" || true # pkill sleep for next wallpaper xd
done
'';
# restartTriggers = [wpaperdConf];