Script for Shuffle Walpapers in Plasma-Stretch

Share your own howto's etc. Not for support questions!
Post Reply
User avatar
Posts: 1900
Joined: 2015-04-02 13:15
Been thanked: 1 time

Script for Shuffle Walpapers in Plasma-Stretch

#1 Post by bester69 »

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 ...

Post Reply