Proposal: Dynamic Wallpapers in Plasma

Vlad Zahorodnii vlad.zahorodnii at kde.org
Tue Mar 10 11:21:19 GMT 2020


Hi,

I would like to propose a dynamic wallpaper plugin for KDE Plasma [1].

As the name suggests, the plugin updates the background continuously to 
reflect the user's current light situation. Besides being eye-candy, it 
can be useful for a Night Mode (if Plasma gets one).

The HEIF file format is used to store dynamic wallpapers. Each image in 
a dynamic wallpaper has metadata associated with it. The metadata 
contains information such as the position of the Sun, and the time. The 
plugin uses the metadata to determine what image(s) must be shown at the 
current moment. The solar metadata is optional. It will be used when the 
plugin is able to construct the path of the Sun; otherwise it will 
fallback to using time metadata.

The only big issue with using the HEIF file format is that Qt doesn't 
have full support for it on Linux. I assume that's the case because the 
HEIF file format was introduced quite recently (iirc, in 2015 or 
something). So, there's no a QImageIOHandler for HEIF files and the 
QImageReader class can't be used to read image collections (it's good 
for reading image sequences, though).

Due to the aforementioned issues, the dynamic wallpaper plugin ships a 
small library that contains two classes (KDynamicWallpaperReader and 
KDynamicWallpaperWriter) that can be used to read and write dynamic 
wallpapers. Even if Qt gains a QImageIOHandler class for HEIF files, we 
would still need those two classes because QImageIOHandler lacks an API 
to read and write image metadata.

In addition to the helper library, the plugin ships an utility that one 
could use to create a dynamic wallpaper from a collection of jpg or png 
files.

I would like to stress that we probably still need a QImageIOHandler for 
the HEIF file format in order to have file previews. It's worth to point 
out that there is an upstream patch to add one [2].

In general, the core part of the plugin is complete. What is left to do 
is to clean up code turds and finish writing documentation.

Any thoughts?

Cheers,
Vlad

[1] https://invent.kde.org/vladz/plasma5-wallpapers-dynamic/
[2] https://codereview.qt-project.org/c/qt/qtimageformats/+/236077


More information about the Plasma-devel mailing list