Not for the weak-hearted

My blog has been rather empty lately. It’s not because I haven’t had anything to report, but due to the fact that many things have happened and all sorts of cool things in Plasma Active’s “Activity world” started appearing that I didn’t have the time to write about them.

Today, I’m going to write about one of the smallest things I’ve done lately that will change the world :)

startkde

startkde script had served us quite well for a long time now, and it is still the best way to start your Plasma session. But it has some downsides that we needed fixed in Plasma Active, and some features that Plasma Active doesn’t need.

So, this post is about an alternative approach to start Plasma, a new application called startactive. It is NOT a replacement of startkde, but an alternative. Meaning that it doesn’t do all the things startkde does, while it does some work that startkde doesn’t.

The design

The main goal of startactive’s design was to create a dependency-based system that starts various workspace components.

You can see the dependencies of various systems that startactive invokes in the following graph.

Dependency graph
Dependency graph

The blue items are meta-modules - they don’t start anything but they make it possible to keep the organization manageable.

Waiting and starting

The system starts all the free modules (modules that don’t depend on anything) at the same time (makes a nice performance boost on both single and multi-core systems), and then waits for some of them to finish until a new module becomes free. When it does, it is automatically started.

There are two ways to see when a dependency has finished its job - 1st - the usual - wait for the process to finish; and 2nd - wait for the program to register its D-Bus service. (org.kde.nepomuk.services.nepomukqueryservice for Nepomuk, org.kde.plasma-desktop for regular Plasma etc.).

Splash screen

Now, when you’re making something that doesn’t need to provide any compatibility with existing systems, you have the freedom to do the things as you see fit. So, I felt free to abandon the old splash screen engines that KDE Workspace used, but to focus only on the QML one I blogged about some time ago. It is now run in-process avoiding dirty ways of communication via X-events and such.

The missing features

startkde does a lot of things, from the initialization of the user’s .kde directory, to fonts, mouse cursors etc.

startactive doesn’t for one simple reason - all of that should be already set up on your Plasma device. All environment variables, Qt plugin locations, directory infrastructure…

Don’t try it

The code is currently located in kde:scratch/ivan/startactive and you shouldn’t use it. Unless you are a really brave soul who doesn’t care if startactive jumps out of the system and start killing kittens in your neighbourhood.

For me, it killed only two older felines, and now it has returned and manages my system with only a few smaller issues. So, if you are brave enough, then continue reading.

To test, you’ll first need to compile it and install with the same prefix as the rest of your kde system, which in turn needs to be in your PATH. Otherwise it will not work.

Then, you’ll need to adapt the module files to fit your setup and finally start the application in an empty X session.

An ordinary startactive will do - it will, by default, start the plasma active module, but if you want to run a desktop session, and change the splash screen theme, you can do something like this:

startactive --modules desktop --splash somethemename

Missing modules

If you notice that something is not started while it should, ping me here or on IRC and tell me about it.