Templates to create your own Plasma Wallpaper plugin

More than just a painting on the wall

As you might know, the very background of a Plasma workspace, a.k.a “wallpaper”, is painted by a special kind of full-screen applet, in Plasma terms “wallpaper plugin”. These wallpaper plugins not only allow to do static display of e.g. a given picture, but also some dynamically changing display, even interactively controlled by the user.
One can select the type of the wallpaper by selecting between available wallpaper plugins in the settings of the workspace. A default Plasma installation usually provides wallpaper plugins for at least the types “Color”, “Image”, and “Slideshow” (sources in plasma-workspace repository), and can also have “Picture of the Day” as well as the animated graphic wallpapers “Haneau” & “Hunyango” (sources in kdeplasma-addons repository).

Bring your own wallpaper

One of the Plasma concepts being customizability, one of course can write their own wallpaper plugin for a complete custom look and behaviour of the background.

So people have done. And not only for demoing the power of QtQuick2 and the OpenGL backends with some interactive fireworks wallpaper (sound effects there though left to user as by example of linked video 😉 ).
One can find e.g. wallpaper plugins like “Video wallpaper” or “Ken Burns effect slideshow” in the “Plasma Wallpaper plugins” category in store.kde.org. Or soon use (again) the Marble-based “World Map wallpaper” (sadly got broken unnoticed and only restored in time for KDE Applications 18.04). Or in the future find relaxation with the animated Asciiquarium.

Then there is also the Plasma wallpaper plugin example with animated falling tree leaves (sources in plasma-framework repository).

Templates for some DIY in the hobby room/garage

To help you implementing your own idea for a wallpaper plugin, the Plasma libraries part of KDE Frameworks are providing you with a Plasma wallpaper plugin template in the kapptemplate format, as supported by KAppTemplate or KDevelop. It is usually part of the additional development package in Linux distributions (e.g. “plasma-framework-devel”). Starting with upcoming KDE Frameworks version 5.45 this month there will be even two versions, the existing template for a QML-only version and one new template for a version where one wants to include other compiled code using an own QML extension plugin (get this template already here).

With such templates, an initial running version of your own wallpaper plugin is just a few steps away. Create a new project from the template, e.g. with KAppTemplate…

Creating a new Plasma Wallpaper plugin from a template using the KAppTemplate application

… then follow the README in the created sources to build and install the wallpaper plugin. Both templates generate some sample code which shows some configurable text in the middle of the wall, eh, background. So open the settings dialog, select the new wallpaper plugin, enter some text in the sample configuration field and apply…

Configure the new Plasma Wallpaper plugin

And then go and make the Plasma wall all yours 🙂

Advertisements

Present your images from the couch with Gwenview, MPRIS & KDE Connect

((Okular contributors, take a note of the end))

KDE Applications 18.04 Feature Freeze is setting in. Or: reminder to do finally that feature you always wanted to implement.

This time for me it’s remote control for presentation-like media shows. Think slideshows of images/videolets e.g with the image browser Gwenview, or presentations given with the document viewer Okular. Would be nice to do this from across the room or stage, being deep in your comfortable furniture or when standing by the auditorium, would it not?

There is your wireless input controllers to help you. But…

… we want more, like:

  • seeing ourselves the notes for the current slide
  • seeing a preview what is coming up
  • being able to jump straight to a picture or slide without everyone seeing our desperate search for that in the overview list (avoiding also spoilers with not yet shown ones)

Obvious idea: use your smartphone as rich remote control. Just write a controller app which talks to your app on the computer running the presentation. Profit.

Though only profit for the given app. Would it not be nicer if there were some standard interfaces, so remote controllers would work across applications? We have seen that before, for music and movie players. In the FLOSS world there is e.g. the Media Player Remote Interfacing Specification (MPRIS). And if we think about it, “media” is an abstraction, one which also can cover images & slides. Though the rest of the spec then uses concepts and terms which are rather bound to typical music players, like “track” or “playlist”.
So not usable for our purpose. Or? If we ignore the actual terms, we find we can map their abstract data model with some flexibility onto the data model of a simple one-dimensional slide-by-slide/image-by-image presentation. And by doing so instantly can get access to the existing MPRIS controllers, allowing us to walk through the slides, going fullscreen, start playing & pausing and so on. Controllers like e.g. the MPRIS-based media controller plugin for KDE Connect.

So it’s just adding a MPRIS-wrapper to e.g. Gwenview or Okular, and we have some initial working remote controllers for them. Now this sounds fancy to have, no?

And for Gwenview, I can happily report that by some hard review work of Henrik F. a first version has just been merged. Shipping to everyone as part of KDE Applications 18.04.

For Okular we have a similar patch. Though it needs some good souls to give it a complete review in the next 7 days, otherwise it will miss out for the upcoming release and be at least delayed some more four months.

The patches should be also interesting to adapt for photo management applications like Digikam or KPhotoAlbum.
So want to give your vacation report to your friends while sitting next to them on the couch as well? Have a look at those two patches and try to adapt them for those applications, you will see it is rather simple value and action forwarding code 🙂

KMarkdownWebView 0.5.0

KMarkdownWebView 0.5.0 has been released.

Example: KMarkdownWebView KParts plugin used by Ark (using Oxygen theme for some retro look 🙂 )

The KMarkdownWebView software is for the rendered display of Markdown documents, using web technologies. It implements a C++/Qt-based wrapper around a local webpage with a JavaScript library (“marked”) which creates HTML from the plain text in Markdown format passed in.
The software contains

  • a KParts plugin for rendered display of Markdown files, which enables KParts-using applications (like the archiving tool Ark or the file manager Krusader) to show Markdown files in the target format.
  • a Markdown file KIO thumbnail generator plugin, which allows KIO-powered file managers & dialogs to show thumbnails and previews of files in Markdown format in the target format (currently only available when building against QtWebKit)

The KMarkdownWebView KParts plugin is also prepared for improved experience with the KTextEditor Document Preview plugin for KTextEditor-based applications like the editor Kate and IDE KDevelop.

KMarkdownWebView can be built with either QtWebEngine (preferred by the build system) or QtWebKit. Pass -DUSE_QTWEBKIT=TRUE to CMake to enforce the use of QtWebKit.

Changes since 0.4.0

  • Update of “marked” source copy to latest release v0.3.12
  • Translations updated for some languages (fi, fr, sl)

Download sources

Download from: https://download.kde.org/stable/kmarkdownwebview/0.5.0/src/

sha256: 84bcc4b2626109241633a52ee5cd203105fd2488277b478572a3a5b593d3de42 kmarkdownwebview-0.5.0.tar.xz

Signed with my PGP key
E191 FD5B E6F4 6870 F09E 82B2 024E 7FB4 3D01 5474
Friedrich W. H. Kossebau
kmarkdownwebview-0.5.0.tar.xz.sig

Three old Plasma Weather applet TODO items gone for Plasma 5.12

Just when I thought to have missed yet another Plasma feature freeze deadline with the one for Plasma 5.12 LTS and thus a good(?) excuse to re-decrease priority of some planned work on the Plasma Addons Weather applet (from the kdeplasma-addons repo, not to be mixed up with clearmartin’s one from github/store.kde.org) once more and thus delay things even further to a day that may never come, the Plasma team found they need to shift the deadline by some weeks to be after the KDE Frameworks 5.42.0 release.
So excuse gone, no other quickly found… time to do a git pull and open the editor.

It’s almost two years ago that the old Plasma Addons Weather applet got ported to Plasma 5 with an initial release in Plasma 5.6. That activity resulted in some plans for further work, which then though met a sad fate of plans… staying on paper to some degree. Let’s revisit the points of the plan and their state:

  • Breeze-style weather state icons: done -> hurra for hard-working Ken
  • Overhaul of look: only cosmetic changes applied, bigger redesign never turned into code -> FAIL
  • support for more weather data providers: a template for provider plugins has been done and added, but no-one ever contributed a plugin for a new provider -> FAIL so far
  • also temperature displayed in compact widget variant, like on panel: got lost in layouting code -> FAIL
  • privacy control which weather data providers are queried on finding weather stations: never worked on -> FAIL

Add to that a Plasma 5 Porting TODO item from the code:

  • Restore night-style icons for observation weather conditions at night: never worked on -> FAIL

Living in some slightly northern of the northern hemisphere, right now the days are short and the temperature is often around the freezing point. Which makes the weather applet look slightly broken and useless: not showing the temperature directly on the panel for a quick glance to check whether it is slippery outside, but showing the weather observation report with the sun symbol in the icon when it is dark outside… who needs or wants that. Still the applet is working too well for just proposing to wipe it from the repos in favour of one of the alternative ones out there. Of course there is also that tiny bit of pride in the porting work done, which begs for throwing more good time after it… 😉

So motivation collected, some coding time shuffled free: the fight against the new Plasma 5.12 feature freeze deadline was picked up. And to make the already too long story short, I can now happily report that with the help of Kai Uwe and some further random Plasma developers the last three items can now be checked off as Done starting with Plasma 5.12 🙂
(Well, almost, truth is that proper night-style icons are still not available for some stations/providers or delivered data, fixing needs a bigger redesign, which is left for another time)

Selecting which weather service providers to query for a location in the Plasma Weather applet. Spot also the optional temperature shown on both panels next to the weather state icon, as well as proper night-style weather state icon for England’s London during current CET night (sorry for German/English mix in UI, too sleepy for proper setup)

So some 2018 FLOSS contributions of mine done. Now I can slack off the rest of this year! 😛
And watch you doing yours by implementing a plugin for your favorite weather data provider?
Which, BTW, will be also useful to any other Plasma applet which makes use of the Plasma Weather dataengine from the plasma-workspace repo.

KMarkdownWebView 0.4.0

KMarkdownWebView 0.4.0 has been released.

Example: KMarkdownWebView KParts plugin used by Ark

The KMarkdownWebView software is for the rendered display of Markdown documents, using web technologies (native wrapper around a webpage with a JavaScript library which creates HTML from the plain text handed in).
The software contains

  • a KParts plugin for rendered display of Markdown files, which enables KParts-using applications (like the archiving tool Ark or the file manager Krusader) to show Markdown files in the target format.
  • a Markdown file KIO thumbnail generator plugin, which allows KIO-powered file managers & dialogs to show thumbnails and previews of files in Markdown format in the target format (currently only available when building against QtWebKit)

The KMarkdownWebView KParts plugin is also prepared for improved experience with the KTextEditor Document Preview plugin for KTextEditor-based applications like the editor Kate and IDE KDevelop.

KMarkdownWebView can be built both with QtWebEngine (preferred by the build system) and QtWebKit. Pass -DUSE_QTWEBKIT=TRUE to CMake to enforce the use of QtWebKit.

Changes since 0.3.0

  • New feature in KParts plugin: show hovered link in status bar
  • Fix: KParts plugin appstream metadata had wrong type
  • Translations updated for some languages (cs, da, de, en_GB, fr, ko, pl, sr@ijekavian, sr@ijekavianlatin, sr@latin, sr, zh_CN)

Download sources

Download from: https://download.kde.org/stable/kmarkdownwebview/0.4.0/src/

sha256: 38b72ba6fa4b513002e7873d2b774e50d676fc878a38b18e6eb9636b53b4c29d kmarkdownwebview-0.4.0.tar.xz

Signed with my new PGP key
E191 FD5B E6F4 6870 F09E 82B2 024E 7FB4 3D01 5474
Friedrich W. H. Kossebau
kmarkdownwebview-0.4.0.tar.xz.sig

KTextEditorPreviewPlugin 0.2.1 (last stand-alone)

KTextEditorPreviewPlugin 0.2.1 has been released.

Example: KTextEditor Document Preview plugin used with Kompare KParts plugin in Kate

The KTextEditorPreviewPlugin software provides the KTextEditor Document Preview Plugin, a plugin for the editor Kate, the IDE KDevelop, or other software using the KTextEditor framework.

The plugin enables a live preview of the currently edited text document in the final format, in the sidebar (Kate) or as tool view (KDevelop). So when editing e.g. a Markdown text or an SVG image, the result is instantly visible next to the source text. For the display the plugin uses that KParts plugin which is currently selected as the preferred one for the MIME type of the document. If there is no KParts plugin for that type, no preview is possible.

Download from:
https://download.kde.org/stable/ktexteditorpreviewplugin/0.2.1/src

sha256:
f5fd393f15fb04a49b22b16b136b1f614f4d5502a9a9a0444d83a74eff3a1e19 ktexteditorpreviewplugin-0.2.1.tar.xz

Signed with my new PGP key
E191 FD5B E6F4 6870 F09E 82B2 024E 7FB4 3D01 5474
Friedrich W. H. Kossebau
ktexteditorpreviewplugin-0.2.1.tar.xz.sig

Change since 0.2.0

  • Translations improved and added for new languages (es, pl, ru)

Notes

This is the last stand-alone release of this plugin. It has been merged post-release as planned into the Kate repository, so will see its future releases as part of Kate, with the first being the ones as part of KDE Applications 17.12.

Developers: Improve your favourite KParts plugin

While a usual KParts plugin works out of the box, for a perfect experience with the Automatic Updating option some further improvements might be needed:

A few KParts plugins have already seen such adaptions, like the SVGPart and the KUIViewerPart (see also blog post), adaptions to be released with KDE Applications 17.12.
Another KParts plugin has been written with that in mind from the start, the KMarkdownWebViewPart (see also blog post), which already has been released.

You might want to take some guidance by the respective commit “Support loading by stream and restoring state on reload” to the SVGPart repository.

KMarkdownWebView 0.3.0

KMarkdownWebView 0.3.0 has been released.

Example: KMarkdownWebView KParts plugin used by the KTextEditor Document Preview plugin used in KDevelop

The KMarkdownWebView software is for the rendered display of Markdown documents, using web technologies (native wrapper around a webpage with a JavaScript library which creates HTML from the plain text handed in).
The software contains

  • a KParts plugin for rendered display of Markdown files, which enables KParts-using applications (like the archiving tool Ark or the file manager Krusader) to show Markdown files in the target format.
  • a Markdown file KIO thumbnail generator plugin, which allows KIO-powered file managers & dialogs to show thumbnails and previews of files in Markdown format in the target format (currently only available when building against QtWebKit)

The KMarkdownWebView KParts plugin is also prepared for best experience with the KTextEditor Document Preview plugin for KTextEditor-based applications like the editor Kate and IDE KDevelop.

KMarkdownWebView can be built both with QtWebEngine (preferred by the build system) and QtWebKit. Pass -DUSE_QTWEBKIT=TRUE to CMake to enforce the use of QtWebKit.

Changes since 0.2.0

  • New feature in KParts plugin: text search
  • Fix: Unbreak navigation to local anchors in QWebKit variant

Download sources

Download from: https://download.kde.org/stable/kmarkdownwebview/0.3.0/src/

sha256: 8b58c85c64641ba2194db1741ed5cc65504b18ced89728b09c6bfd090da847e4 kmarkdownwebview-0.3.0.tar.xz

Signed with my new PGP key
E191 FD5B E6F4 6870 F09E 82B2 024E 7FB4 3D01 5474
Friedrich W. H. Kossebau
kmarkdownwebview-0.3.0.tar.xz.sig