I noticed a lot of people are having problems finding a proper wallpaper changer for Lubuntu. I for one haven't been able to find a program that actually works right with PCManFM, this includes Nitrogen and feh among others.

However I've been able to create a pretty simple script to get around this.

Make sure to add this into your autostart programs if you want to use this. You can do this by going to:


Edit the file and add "@ /home/USERNAME/PATHTOSCRIPT" as you may notice with the other autostart apps.

PATHTOSCRIPT means the file path to script.

This is the script:

while [ $n -le 10 ]
sleep 8m &&
NUMBER=$[ ( $RANDOM % 81 )  + 1 ]
pcmanfm --set-wallpaper=/FILE_PATH_TO_WALLPAPERS/$NUMBER.jpg
For FILE_PATH_TO_WALLPAPERS you set the correct file path for me this was /home/bewbman/Wallpapers/ then my wallpaper was selected from this folder.

The n set to 10 is obviously to create an infinite while loop so this keeps going on as long as its running.

You can set whatever time you want for sleep, whether it be 5s or 1h, you choose that option.

The NUMBER variable is to create a random variable to choose a picture from your folder, in here I have renamed the desktop pictures 1 - 81.

So if you have 50 wallpapers MAKE SURE to change the number after "$RANDOM %" to how many wallpapers you have.

It will pick a random number from 1 to whatever the number you have defined is and set the file path to that.

For png images you can simply rename them to jpgs and it will recognize them as jpgs.

When taking this script after you've modified it to the correct values place it in the folder you want, and save it in a text file. Make sure the name ends in .sh to make it a script. For me it was random.sh. Make sure to right click on it as well and go to properties, go to properties and click on 'Make It Executable'.

After this you can test it in terminal just by running the filepath/filename.sh in terminal.

It needs some user modifications but it works as a charm and as far as I'm concerned I haven't found anything that really works for this. This is also very light and does the job that you want so I'm happy with it. Was sharing it for others.