Bubblemon in 4.3!

A few hours ago I moved Bubblemon out of kdereview and into kdeplasma-addons.

Keep an eye out when 4.3 ships. You’ll like it :)

Comments »

Plasma speaks!

Last night I committed a quick patch to Plasma’s plasmaclock library that almost all plasma clocks use. It changes the configuration interface a little bit to add one neat feature: speaking the time.

Now, you can configure any plasma clock to speak the current time every Nth minute of the hour. I was inspired by a neat little Android app I found the other day for my G1 called “Talking Clock”, which speaks the time every hour. Very handy.

As part of changing the configuration interface, it renames the “Calendar” page to “General” and uses Applet::icon(). I also went in and changed the analog-clock and digital-clock plasmoids’ “General” pages to “Appearance”. Now there aren’t a whole mess of clock icons in the settings :)

Comments »

The Future of Glovebox

The middle of last year, I started working on Glovebox, a rather ambitious project for a car computer environment.

One of the biggest choices I made was to write my own set of UI libraries on top of Qt to mirror the kind of integration that KDE has. This was mostly because I didn’t want to drag in the few hundred MB needed for Plasma.

Wow, that past me was an idiot. Lets all point and laugh.

Ever since Plasma got moved into kdelibs, I’ve been thinking on and off about building Glovebox on top of KDE. For some reason over the past few weeks I started thinking more seriously about it.

At any rate, I’ve decided to go ahead and do that. I’ve also thought about another good idea. I’ll allow Glovebox’s UI to run under an X server in addition to the original idea of using Qt Embedded’s framebuffer stuff.

So most of tonight will be spent hacking the build system and Launchpad into shape, followed by restructuring the page plugin system to use KParts.

Comments »

KPackageKit 0.4.0 Released!

3 days ago, Daniel announced the release of KPackageKit 0.4.0. Outside of the lone message on packagekit-devel, I haven’t seen much hooplah, so here I am writing up a news release for the planet. Our last release was way back before October, so quite a few new features were added since then:

Along with some neat minor features:

For those not in the know, KPackageKit is the KDE frontend to PackageKit, the unified package management system. PackageKit doesn’t replace your distro’s default manager (eg, yum, apt, rpm, or dpkg), but it improves upon it by giving a generic D-Bus interface. Frontends (like KPackageKit, or gnome-packagekit) use these simple calls to do normal tasks like updating your system, checking for updates, and installing packages.

To get the ‘official’ release in SVN, check out revision 927064.

My current project for KPackageKit is implementing the client-side D-Bus interface for apps to install things like media codecs and fonts on the fly.

Comments »

So, yes, perhaps I was an idiot

So in my last post, I said this in reference to bubblemon:

While writing this, I found a few possible bugs in plasma. I say possible, because I’ve been known to be an idiot sometimes

Turns out using setAspectRatioMode(Plasma::Square) fixes it:

Bubblemon in the panel with its proper round shape

Bubblemon in the panel with its proper round shape

You’d think, however, that using KeepAspectRatio (as I previously was) would suffice. If I manually resize, plasma should keep my aspect ratio. I understand now why plasma shouldn’t keep the ratio constant in the panel, but the apidox doesn’t seem to explain that.

Anyways, I added two important (and two mundane) features to bubblemon this morning at some ungodly hour. Anti-aliasing, smooth value transitions, label scaling, and support for any ksysguard sensor. To get the last one, I added some code to the systemmonitor dataengine that supplies various metadata, such as maximum, minimum, translated name, and translated units. Now its a lot easier for anyone to get, say, the current total memory on the system without having to request mem/physical/free and mem/physical/used.

The label scaling is the other important feature. Quite simply, when the label is too big to fit in the sensor, the text gets word wrapped and the font keeps shrinking ’till it fits. If the text is too small for even a 1pt font to fit it in, it won’t even bother showing text. After all, text at that size is just impossible to read. IMHO, I think this makes bubblemon as complete as it can be.

Now I can go back to helping hack KPackageKit into a form resembling a release. And sleeping.

Comments »

Hello, planet!

So, uh, hi there. I’m new to the planet.

To get things started, I’m Trever, a 20 year old CS student from the good ‘ole US of A, which may or may not be true depending on your opinion of the united states. Your call. Anyways, I’ve been hacking on KDE on and off since 2007ish. The most I did was make a few patches for Amarok and just go bug hunting. Oh, and coding a lot of PHP. Apparently I’ve grown out of my PHP phase and moved on to bigger things with C++ and python. I’m one of the two people (the other one is Daniel) who work on KPackageKit, the KDE frontend to PackageKit. KPackageKit was the big reason I started hacking on KDE for real. It has also been rumored that I help work on the KDE bits for PolicyKit in fits (this rumor was started by me).

Cool, now that bit is out of the way. Now for something completely different, and really neat. I call it “Bubblemon”:

Bubblemon showing roughly 50% CPU usage

Bubblemon showing roughly 50% CPU usage

You can find it in playground/base/plasma/applets/bubblemon.

I’ve had the CPU plotters provided by the system-monitor plasmoid bundle, but I thought they were too boring, hard to see current usage at a glance, and I couldn’t really shrink them small enough. I think bubblemon addresses those shortcomings. Bubblemon is a glass sphere that fills up with some kind of goop depending on what it is monitoring. The cool thing is, the more full it is, the more it boils. Yes thats right, this is a cool animated plasmoid. It is guaranteed to wow your friends[1]. The hotter it gets, the faster it boils with more bubbles.

In addition to monitoring your CPU usage, you can also monitor your memory usage. Soon, I’ll be adding temperature monitoring once I rework some of the internals (its all about plugins, man).

While writing this, I found a few possible bugs in plasma. I say possible, because I’ve been known to be an idiot sometimes. For instance, there’s this:

Bubblemon chilling in the plasma panel

Bubblemon chilling in the plasma panel

Putting it in the panel doesn’t seem to respect the plasmoid’s aspect ratio. I’m not entirely sure why this might be happening, as the battery plasmoid doesn’t have this problem, and I used it as reference for most of the code. I also haven’t updated my kdelibs with kdesvn-build since a month ago, so I’m not sure if it is fixed or not. Another issue I found was the lack of a plasma API to handle my animation. Bubblemon is forced to create its own QTimer, which is then connected to a slot that moves the bubbles and calls for a repaint every 40 ms, giving a 25fps animation. This gives plasma an ungodly number of wakeups per second. Not entirely sure if that can be helped though. However the methods that actually move and draw the bubbles take up 50% of my CPU (10 of which is system), which is unacceptable even on this dual core 2Ghz thinkpad.

The good news though, is that when my laptop goes on battery power, Applet::shouldConserveResources() returns true and bubbles are no longer bothered with, dropping CPU usage down to about 3%. If there’s any C++ gurus around who can figure out what is being such a resource hog, you’d be doing something pretty awesome for me. I’ve ran it through valgrind a few times, and it seems like most of the work is spent blending textures together in Qt. Later this week I might try 4.5 to see if that fixes anything.

1 Not an actual guarantee.

Comments »

Python Plasmoid on TechBase

Most of this weekend I spend digging through some of the lightest documentation around, trying to figure out how to make a simple plasmoid in python. Took me over two days, but I finally got it done. I even wrote a tutorial on how I did it!

The fruits of my labor:

PowerChart

And of course, powerchart-pre0.1.plasmoid

Comments »

KPackageKit Progress

Over the past week or so, Daniel and I have been hacking on improving KPackageKit. Our original goal was to get it into the 4.2 release. Doing this depended on getting PolicyKit-KDE into base before release time, but that didn’t happen either. But hey, now we’ve got a few months to do tons more improvement.

The biggest change was how the automatic updates are handled. Previously, kded ran kpackagekit --smart-update once a day to check PackageKit if there were any interesting updates. Then it’d show a notification about it and ask the user if they want to upgrade. Now, I’ve moved that chunk into our transaction list icon. kded now calls kpackagekit-smart-icon --update to check for updates. The interval is configurable.

KPackageKit's 'updates available' icon in the plasma tray

KPackageKit's 'updates available' icon in the plasma tray


Once updates are found, a notification is displayed and an ‘updates available’ icon is added to the tray. If any security updates are available, it shows the security icon. If bugfixes are the highest priority available, the bugfix icon is shown, etc. The picture here shows bugfixes in my tray.

Clicking it immediately shows the update KCModule. The module is in the icon app, so loading is lightning fast. An optimization we might do is to go directly from the get-updates transaction and into the KCM’s model. Otherwise, the KCM has to re-fetch the same list we showed in the notification.

By default, all updates are selected and the apply button is enabled. We’re currently discussing some UI tweaks to this that might make it look a bit like this:

A slightly tweaked updater UI

A slightly tweaked updater UI

Icons are added, and the interaction is changed a little. Instead of everything being selected by default, thats all been replaced with a ‘apply all updates’ button. Its still one-click to update everything, but now its also one-click to close the dialog and not have systemsettings ask if you want to save your changes. Of course, if you really want to select everything and click Apply, its at most 3 clicks. Complaining against that will be a federal offense.

The other really important feature I finished was installing unsigned local files. Now I can install Cedega with only one click! There currently is a bug in the released PackageKit yum backend that prevents local files not existing in a repository from being installed, but there’s a patch I wrote getting pushed to git soon.

The last feature I added was reporting all errors with the tray icon. Now when your automatic updates fail, you’ll know why. Once we get the dbus interfaces implemented, we’ll be adding a little bit of code to the icon to only show messages for transactions that don’t have a dialog associated with them.

Oh yeah, and I start my spring semester at Akron tomorrow :)

Comments »

Winter Break

Whew, end of the fall semester. It seemed to fly by rather quickly. So anyways, I’m finally at home and able to do some full-time KDE hacking. I originally came home wednesday night, and found that Kuiper (my firewall box) had bit the dust some time ago. It’s fedora core 3 (hey, remember that one?) install seemed to have eaten its root partition alive somehow, as fsck couldn’t recover it, complaining about missing superblocks and such. I didn’t really want to spend a lot of time on a fancy recovery process, so I opted to install m0n0wall on it. I eventually got that accomplished. It took a while (I’ll explain it later this week), but it more or less works now. I need to add more memory to Kuiper’s case, as 64Mb isn’t cutting the mustard for the latest beta. I’m using the beta for the IPv6 support, which is really cool by the way. Yay modernization.

My internet on campus for my last few weeks on campus wasn’t cooperating (in short, I no longer trust UA’s network with /anything/), combined with finals kept me from pouring a lot of effort into KDE into KDE/Glovebox/Pointything. I haven’t been entirely out of the loop though, as I’ve managed to keep up with the commit mail and KDE mailing lists.

I’m not entirely done settling in yet though. I’ve got a few important things to do I didn’t get done last summer:

I already knocked one thing off my list with my install of m0n0wall: figure out port forwarding. Right now wm161.kicks-ass.net should have my home network’s IP address, and port 80 redirects to Saturn, while ssh goes to Jupiter. Both of those machines are down right now, as Jupiter is being stubborn and not turning on. Without Jupiter’s LDAP, saturn is clueless. I’m thinking its getting close to retire Jupiter from constant service anyways, now that Kuiper is capable of supporting an IPv6 tunnel and dynamic DNS updates to permit remote access to my network.

Comments »

Messing around with KNotify

As part of KPackageKit, there are two important programs. The first is the kpackagekit executable, which actually shows the main add/remove/update selection Ui. The second is kpackagekit-smart-icon, which shows the transaction list in your system tray.

The current SVN has a KDED module which runs kpackagekit-smart-icon when DBus announces a transaction change, and it runs kpackagekit --smart-update which shows the little popup informing you about available updates.

For the weekend, my goal was to move the notifications out of the main UI and into the helper icon app. It makes sense to me, because we don’t want to have to load up a big fancy Ui for a backgrounded, windowless task. It also makes sense because then we can show error messages for transactions, and even have a small ‘updates available’ icon in the tray, just like packagekit-gnome can do.

Daniel apparently tried this once before but wasn’t able to accomplish it right. He said that the popups kept saying ‘kpackagekit-smart-icon’ in the title, even though every string was set to ‘KPackageKit’. For some reason, I didn’t want to believe that KDE would force this restriction on a program, that the popup title must be the application’s name. The API documentation doesn’t say how to accomplish this, so I started digging through the sources.

When you send a notification, the KNotification class calls KNotificationManager::notify(this, pixmap, actions, contexts, appname). The appname is taken from the appname specified in the program’s KAboutData, and is used to find the notifyrc. KNotificationManager then sends the message out to org.kde.KNotify over dbus, which is picked up by the knotify4 daemon.

Once it reaches the daemon, the appname.notifyrc is read and the proper plugins (passive popup, sound, etc) are activated. As for the popup plugin, the private fillPopup() is where the magic happens. It loads in the IconName specified in the notifyrc, along with the undocumented Name entry. If no icon is specified way back up at KNotification::event(), the default icon is used, and the appName is used if there is no Name entry. After that, the popup widget is setup and displayed.

It is a bit annoying that I have to dig through all the sources in both kdelibs and kdebase just to fix the simple problem of changing the popup’s title. I notice that techbase doesn’t have anything about how to do this, so you should expect an article written up there soon.

Comments »