N.B. Python for Android (required for this) doesn't work on Android 5.0. I suspect this is due to an incompatibility with the ART runtime. Additionally, it seems there's been little to no development on Python 4 Android for quite a while. It appears to be a dead project. So, if you are running a recent version of Android, this won't work for you. I'm considering alternatives, as I was using quite a few Python-based Tasker tasks.
These scripts allow a person using the Variety desktop switcher to copy their backgrounds to their Android device automatically through Tasker and regularly switch backgrounds.
Firstly, a publicly accessible web server is required. You'll have to add the make_image_rss.sh
to your variety set_wallpaper
script. The script is normally found (on Linux) at ~/.config/variety/scripts/set_wallpaper. Simply add the following line to the end of the file:
bash /path/to/make_image_rss.sh "$3" /path/to/wallpaper http://example.com/wallpaper
In this line, make sure to use the right /path/to/make_image_rss.sh
. /path/to/wallpaper
should be the path on your filesystem to the folder where your web-accessible images will be stored. http://example.com/wallpaper
will be the same path on the web.
Next, on your Android device, you will need Tasker, SL4A, and Python for Android.
You will need download_rss.py
on your Android device. Don't bother trying to run it straight from SL4A. It won't work without Tasker.
Within Tasker, you'll need a few variables set:
%WALLPAPERFEED
should be the full path to your feed. In the example above, it would behttp://example.com/wallpaper/feed.xml
%WALLPAPERDIR
will need to be the path on your device where you want to store your images. I have mine set to/storage/sdcard0/Wallpapers
. It will, of course, need to be a path that's writable by SL4A.
Next, you'll need the Download From RSS task, the Random Wallpaper task, and the wallpaper_switch.js
script. Put the script in your Tasker/scripts/
folder (or modify the task to point to the path you use). Then import both tasks.
Finally, you'll need some profiles to run those tasks. I have Random Wallpaper Switch run every twenty minutes, and Download From Rss run every hour.