23 lines
659 B
Bash
Executable File
23 lines
659 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# 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
|
|
# Create symbolic link to the selected wallpaper
|
|
ln -sf "${RANDOMPICS}" "$HOME/.config/hypr/.current_wallpaper"
|