Script for Shuffle Walpapers in Plasma-Stretch

Share your own howto's etc. Not for support questions!

Script for Shuffle Walpapers in Plasma-Stretch

Postby bester69 » 2020-11-27 13:48

I made following script to shuffle wallpapers in order to plama desktop pick different ones every day/some days. Plasma desktop has "Presentation" as a changing scheduled wallpaper option, but if we rollback home.. It will repeat back the sequence of wallpapers cos it doesn shuffle them or just shuffle them first we repeat walpapers sequence once we rollback home :(


So, I made this beautifull script. :o :
The script search for jpeg and png wallpapers, then assign them a random base name, and then hardlink all of them to the target plasma walpaper path..I used hardlinks to save space and time in images generation..

WALLPAPERS == directory where we store all our wallpapers folders
WALLRANDOM == target path used in plasma for wallpapers
WALLtemp == temporary folder work
Code: Select all

mkdir -p "$WALtemp"
cd "$WALtemp" && rm *
find "$WALL/" -type f -name "*.jpg" -exec ln  "{}" \;
find "$WALL/" -type f -name "*.jpeg" -exec ln  "{}" \;
find "$WALL/" -type f -name "*.png" -exec ln  "{}" \;
#-sf "{}" \;
for i in *.jpg; do mv "$i" $RANDOM$RANDOM.jpg;done
for i in *.jpeg; do mv "$i" $RANDOM$RANDOM.jpeg;done
for i in *.png; do mv "$i" $RANDOM$RANDOM.png;done

rsync -av --delete --link-dest="$WALtemp/" "$WALtemp/" "$WALLRAN/"
#Dont delete this last line, its needed to trigger hardlinks for plama
touch "$WALLRAN/aa.jpg"

This is how looks like final result of shuffling all wallpapers in target WALLRADOM folder as hardlink images.:
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
Posts: 1871
Joined: 2015-04-02 13:15

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 5 guests