Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Script for Shuffle Walpapers in Plasma-Stretch

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Script for Shuffle Walpapers in Plasma-Stretch

#1 Post by bester69 »

Hi,
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 time..so we repeat walpapers sequence once we rollback home :(

Image


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


aleator.sh

Code: Select all

#!/bin/bash
#
WALL="/media/sda6/systemBackup/WALLPAPERS"
WALLRAN="/media/sda6/systemBackup/WALLRANDOM"
WALtemp="/media/sda6/systemBackup/WALLtemp"

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.:
Image
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

Post Reply