There are several tutorials in the wild that lets you set random wallpapers with Tasker. But most of the tutorials have a common drawback: you need to name the wallpaper files in a certain fashion (mostly with numbers). But this is a daunting task if you have a large collection of wallpapers. So I have devised a simple way for Tasker to cycle through available wallpapers and choose a random one. Here’s how you can ask Tasker to set random wallpapers.
- Create a new “Event” context and select “Display” from event category menu.
- Select “Display Off”. This means the tasks will be fired every time display is off.
- Next create a new task. Click the + button to add actions. Select “File” from list of actions.
- Select “List Files”
- Enter the location of the directory where the wallpapers are located. Mine is inside “wallz”.
- Scroll down in the same action to set the variable to “%wallsrc”. This way we list all files and put the sources inside %wallsrc variable.
- Next, create a new action by clicking the + icon. Select “Variables”. Next, select “Variable Set”. Here, set the name of the variable to %count and value to %wallsrc(#), which represents the total number of wallpapers inside the directory.
- Again, create a new action by clicking the plus icon. Select “Variable”, and then “Variable Randomize”. Set the name to %index and min to 1 and max to %count. With this we find a random number between 1 and the total number of wallpapers.
- For the final action, add a new action and choose “Display” and then, “Set Wallpaper”. Set the value of image to %wallpaper(%index).
- Exit Tasker. Done!
Every time you unlock your screen, you’d find a new wallpaper.
Looking for mobile wallpapers? Check out /r/iWallpaper