Plasma Weather Wallpaper (Hello Planet KDE)

March 31, 2009

So after I implemented tooltip support in QuickLaunch I started to look around for some more Plasma related things to hack on. That’s when I happened upon this, which is how I stumbled upon this

I thought to myself, “That would be really neat!” So a few days ago I made a simple wallpaper plugin that would paint a specified picture to the containment background. Once that was working I raided the weather plasmoid of its configuration code and choice parts of its backend and ported it to work in a Plasma Wallpaper plugin. The result? A Plasma Wallpaper plugin that changes the wallpaper depending on the weather at a set location is. To retrieve the weather it uses the weather dataengine introduced in KDE 4.2, as seen in the Weather plasmoid and the LCD Weather Station plasmoid. Dataengines for the win!

Code is available from trunk/playground/base/plasma/wallpapers/weather. It should build with KDE 4.2 and KDE 4.3. Here’s a small build tutorial:

– svn co svn://
– cd weather
– mkdir build
– cd build
– cmake ../ -DCMAKE_INSTALL_PREFIX=/usr
– make
– sudo make install
– kbuildsycoca4

You should now be able to change the wallpaper type in Plasma’s Appearance settings from “Image” to “Weather”.

Here are screenshots (click for bigger ones), stay tuned for limitations and bugs:

Limitations and Bugs

This plugin is quite new, and as such there are several limitations. Here are the ones I know of:
– It displays tiled versions of 1280×1024 wallpaper. If your screen isn’t the exact size of the wallpaper, the wallpaper will loop.
– The “Wallpaper is loading” wallpaper is cut off in mid-sentence. Dunno how that happened, but I plan to redo that image eventually so it’s sorta just a placeholder for now.
– It doesn’t have images for all possible weathers.
– At the moment it won’t work with the NOAA ion since the plugin currently relies on the icon name returned by the weather dataengine, and the NOAA ion doesn’t return icon names
– Setting the config the first time works, but if you change the config a second time the change won’t take place until you restart Plasma. (Though the preview in the Appearance dialog changes properly, it’s sorta weird)

So, I hope you enjoy it. Once it gets a bit less buggy I’ll probably post this on kde-look and maybe make some K/Ubuntu packages for my PPA.

Oh, in semi-related news I’ve also picked up maintenance of the QuickAccess plasmoid and have done a quick bugfix release that ports the applet to KDE 4.2 and fixes a crash:
Best wishes to the original author.


Zomg! Tooltips! (Or, Plasma is pretty darn easy to hack on)

March 27, 2009

Another little unimportant feature that I did. ™

Two days ago something inspired me to try hacking on Plasma. While I was glancing through KDE’s bugzilla looking for a certain bug, I glanced over and saw that there was a wishlist about the QuickLaunch plasmoid not having tooltips. “That’s strange…” I though, “Lots of plasmoids have tooltips, and QuickLaunch definitely would seem like one of those applets that would/should have tooltips.”

Later that day I had this:

With guidance from the awesome dudes on #plasma I got my patch all up in the reviewboard for review:
A few hours later it got reviewed, and 48 hours ago it got committed to the KDE svn repository; my first “real” contribution, which went from my head to the KDE repo in less than 12 hours flat.

Plasma is pretty easy to hack on, imo. Most of my prior coding experience had been with PyQt/PyKDE programming in python. C++ took a little getting used to I suppose, (I did do one or two handy-dandy patches for Adept in the past though) but the Plasma API is nice to work with, and the other applets were fine examples which made implementing the tooltips easy. The hardest part was actually not making the tooltip, but rather getting the info about the name of the application shown in QuickLaunch from the desktop file to the tooltip. Luckily there’s another applet that also does this, the Icon plasmoid. 😉 With a few pointers from that I had the whole thing compilin’ and displaying nice tooltips in under an hour.

The feature’s nothing really big, and won’t appear until KDE 4.3, but for some reason I felt compelled to share my experience. I guess I just think that this sort of stuff is fun; I hope I can find other things that I am capable of doing to do. 🙂 I think it’s cool how I could just go and implement a feature like that, myself being a novice when it comes to C++. (Though maybe I’m improving? I wouldn’t want to give myself too much credit now :P) When I said that I’d like to blog about something Plasma related last time, I had no idea I’d be blogging about this…

Anyways, go out and test the Beta of Kubuntu 9.04, it’s shaping up to be a real dozy! 😀

Software-properties-kde, jockey-kde enhancements for Jaunty

March 20, 2009

Software Properties

Some enhancements for the KDE frontend of everybody’s favorite /etc/apt/sources.list editor, as launchable from Adept (and more recently lauchable from KPackageKit) have been uploaded just now to Kubuntu 9.04. I actually made the changes back in February, but I forgot to bug mvo enough to get the changes into the main bzr branch…

But that’s all taken care of now. The changes aren’t all that impressive, but I think that they still make a difference. 🙂

One of the more noticeable changes is icons. Before I don’t think there was a single icon in the entire program, except for the window icon. The program was a sea of gray tabs. Now most of the buttons have icons (where it makes sense)


Another noticeable change is the use of the KDE file dialog instead of the Qt one. What can I say? KDE has the best file dialog I’ve encountered. (Even if it’s not perfect, it’s close) If you’re adding GPG keys to apt, you will be seeing less of this:

…and more of this:

Much more pleasant/consistent with the rest of KDE. Though I must say, it’s nice to see pure Qt apps following the KDE color scheme with Qt 4.5. 🙂

On a final note relating to GPG keys, as of Jaunty when no key in the list is selected, the remove button will be disabled. It’s like this for the repository editor, so I dunno why it wasn’t like that for the GPG tab… It’s barely worth a screenshot though.

None of these changes are all that big, but I like talking about stuff like this. And some polish here and there can make a big difference. 🙂 On that note I’m impressed with Kubuntu 9.04 so far. I’m confident that this release will rawk!

In regards to software-properties-kde, for Kubuntu 9.10 it’d be real nice if I could find the time to integrate s-p-k with PolicyKit now that we have a KDE frontend, so that the application doesn’t have to be run as root. Maybe I’ll find time to implement syntax checking when adding repositories too.
In a magical world I suppose it would be awesome to turn it into a System Settings module, but I’m not sure how to make the GUI class a child of both the Software Properties GUI abstraction and a child of the KDE Control Module class…


On the subject of Kubuntu tools turning into System Settings modules, it doesn’t look like jockey will be making it in 9.04. 😦 I never figured out how to make the whole thing thread-safe while grabbing data from the backend, so it still crashes. Oh well.

On the plus side, Jockey did manage to get both PolicyKit and KNotification support in recently thanks to the efforts of Riddell. 🙂 Yes, this means sexy Plasma notifications rather than those somewhat-ugly KPassivePopup balloons, and that you will only be prompted for a password when you try to actually do something that requires a password. Also since it’s not run as root it will use your theme/fonts instead of root’s.

Here’s to a good weekend!

GTK+ apps, QtCurve and Kubuntu 9.04

March 16, 2009

Wow, I haven’t blogged in a while. Maybe I should do so more… Maybe something plasma related. Anyway.

Ever since the KDE4 remix of Kubuntu 8.04 GTK+ applications have suffered in KDE environments. You could either:
– Stick it out with the Windows 95-esque Raleigh theme
– Use gtk-qt-engine to match your current theme with varying results, but mostly poor results with Firefox
– Realize that you can use other GTK themes using the gtk-qt-engine System Settings module to do so. (Not user friendly on many levels)

Usually you had to trade off between a uniform widget style (or an attempt at one) or barf all over your screen. Luckily for us, the QtCurve GTK style has been recently updated to have a more KDE4/Oxygen-esque look and feel. True, it doesn’t fit in perfectly with Oxygen, but even though it is a different theme it fits in a hell of a lot better than the bug-ridden pixmaps gtk-qt-engine would output. (No offense to the gtk-qt-engine author, who sadly seems to have disappeared off the face of the Earth. Best wishes to you)

As of now QtCurve has replaced gtk-qt-engines as the default GTK theme in Kubuntu 9.04. (Meaning that you’ll see this by default for reals in beta. You may have to manually set it if you have alpha 6) And no, we probably won’t set the KDE theme to QtCurve as well, since it looks better than QtCurve, and we don’t wanna diminish KDE’s hotness by using QtCurve for the sake of pixel-perfect uniformity. I know that this paragraph will spark tons of comments about why QtCurve should be default for the KDE widget theme… what am I getting myself in too? Let me just say that there’s a reason the almighty lords of the Unix Epoch invented preferences and configuration for a reason, and leave it at that. 😉 It blends in pretty well, though, so it shouldn’t look *too* inconsistent. (KDE widget style smoke. Don’t breath this[/willitblendpun])

Oh, screenshots. Can’t have a blog without ’em:

My mouse is over that one bookmark next to the blue tooltip, you just can’t see it…
As you can see, though, QtCurve:
– Follows your KDE icon theme (a bit better than gtk-qt-engine I might add)
– Follows your KDE color scheme (Blue tooltips, and an unharsh blue for things like progress bars unlike gtk-qt-engine)
– Has tabs that don’t look too bad ™
– Fits in rather well with Oxygen
– Yes, I have the default Mac OS X 10.5 wallpaper
– No, I am not really all that in to Macs (I just like that wallpaper)
– Yes, not maximizing firefox was just an excuse to show off my plasma widgets. I usually keep my Firefox maximized. 😉

All I can say is that even if the situation might not be perfect, GTK application should look much nicer and integrated in Kubuntu 9.04, and definitely will be a lot less buggy. 🙂