Put near-realtime picture of Earth as your desktop background
himawaripy is a Python 3 script that fetches near-realtime (10 minutes delayed) picture of Earth as its taken by Himawari 8 (ひまわり8号) and sets it as your desktop background.
Set a cronjob that runs in every 10 minutes to automatically get the near-realtime picture of Earth.
- Unity 7
- Mate 1.8.1
- Pantheon
- LXDE
- GNOME 3
- KDE
- OS X
- any other desktop environments that are not mentioned above.
You can configure the level of detail, by modifying the script. You can set the
global variable level
to 4
, 8
, 16
, or 20
to increase the quality (and
thus the file size as well). Please keep in mind that it will also take more
time to download the tiles.
You can also change the path of the latest picture, which is by default
~/.himawari/himawari-latest.png
, by changing the output_file
variable.
If you use nitrogen for setting your wallpaper, you have to enter this in your
~/.config/nitrogen/bg-saved.cfg
.
[:0.0]
file=/home/USERNAME/.himawari/himawari-latest.png
mode=4
bgcolor=#000000
Make sure that you have pillow installed:
pip3 install pillow
Then you can install himawaripy:
cd ~
git clone https://github.com/boramalper/himawaripy.git
# configure
cd ~/himawaripy
vi himawaripy.py
# test whether it's working
./himawaripy.py
# set up a cronjob
crontab -e
# Add the line:
*/10 * * * * /home/USERNAME/himawaripy/himawaripy.py
So the issue here is that KDE does not support changing the desktop wallpaper from the commandline, but it does support polling a directory for file changes through the "Slideshow" desktop background option, whereby you can point KDE to a folder and have it load a new picture at a certain interval.
The idea here is to:
- Set the cron for some interval (say 9 minutes)
- Open Desktop Settings -> Wallpaper -> Wallpaper Type -> Slideshow
- Add the
~/.himawari
dir to the slideshow list- Set the interval check to 10 minutes (one minute after the cron, also depending on your download speed)
Many thanks to xenithorb for the solution!
# remove the cronjob
crontab -e
# Remove the line
*/10 * * * * /home/USERNAME/himawaripy/himawaripy.py
# Remove the data directory
# By default, `~/.himawari`. Check `output_file` variable in himawaripy.py
# in case you've changed it.
rm -rf ~/.himawari
# Remove the installation folder
rm -rf ~/himawaripy
If you would like to share why, you can contact me on github or send an e-mail.
Thanks to MichaelPote for the initial implementation using Powershell Script.
Thanks to Charlie Loyd for image processing logic (hi8-fetch.py).
Obviously, thanks to the Japan Meteorological Agency for opening these pictures to public.