You are using an obsolete web browser, or you have the page styles (CSS) disabled. You'll be able to access this site, but only a visually simplified version.

Contouring the Share-Like-Connect

Ok, it is the time for me to blog from Randa and KDE Platform 11 and Nepomuk sprints.

KDE and Gnome collaborationSo, what I’ve been up to? I’ve been finishing the backend stuff and the library for registering the “desktop events” aka opening a document, web page and similar. All that is contained in the activity manager, so all the recorded stats will be tied to specific activities.

Share-Like-Connect

One of the side effects of the /usage tracking/ is that we now know what document is currently being viewed/edited, so the Aaron’s S-L-C concept can finally come to life without using the fake dummy data.

Tasks Documents applet

This doesn’t exist yet, but when applications start reporting which documents they are showing, we’ll be able to make a fully document-oriented workspace for those that like that kind of stuff.

Zeitgeist integration

We (Nepomuk – Trueg and myself) and Zeitgeist people (Seif and Trever) had quite a few hours spent deciding the best way for the two systems to collaborate and I think we have done well. Apps that support Zeitgeist will automatically support us as well, and vice-versa. So, whether you are using a Gnome application in KDE, or KDE application in Gnome, it will just work(TM).

As you probably already know, I’m a sucker for fall-backs, so I still intend to make this work even if you disable one of the services. And it will work, but badly if you disable both of them.

Contour and Plasma Active

The thing worth mentioning is that I’m now a part-time member of the Contour team at basysKom, so you can expect these things to be finished faster than it was when I had to give focus to other non KDE-related projects.

Activity templates and security

Tokamak5 Logo

So, as you all should already know, Tokamak 5 (plasma developer sprint) is in progress. The main desktop-related thing I’ve been working on last two days was presenting a few chosen activity templates as if those were real.

What does this mean? That you’ll see a couple of activities in your activity bar that don’t really exist. This was done, along some other stuff, to promote the activities a bit more.

Activity template

Currently, as far as I know (as usual, I’m the backend guy and have no clue what will end up in the release for the user to see :) ) the only one /fake/ activity you’ll see is the ‘Photos activity’. It is meant for something that we all enjoy – managing our photo collections.

Before you start arguing that you don’t want to see a bunch of templates in your list of activities, this affects only the defaults – you can easily remove them like any other activity – click the red ‘x’ and you’re done.

Running applications

Apart from defining the widgets layout, templates are now able even to start applications. In the case of the ‘Photos’ activity, it will start Digikam and Gwenview.

Since the templates can be downloaded via GHNS (from kde-look and similar sites), automatic execution of apps is rather dangerous, so you’ll be asked for the confirmation on which programs to run.

You can see what it looks like in the screenshot above. Recognized desktop applications are presented with their names and icons, and are automatically selected. While other programs (like in this case ‘rm’) will have a warning icon in front and will be automatically deselected.

EDIT: I’ve just added a rather rigid test for the ‘safety’ of apps – the application is automatically selected only if it is a registered desktop application and it doesn’t have more than one argument specified. So, the things like konsole -e ‘something’ are not going to be selected by default.

As Notmart said “I have a dream!”. (I have no clue what this sentence has to do with the blog post, but I didn’t want to finish it with the usual ‘that’s all for now’ :) )

Back to code, back to the activities [code, openSUSE, Nepomuk, Zeitgeist]

I was (more than) a bit silent lately. The thing called ‘life’ happens and you get dragged away from your computer ;)

Striped SAL

The strange thing is that lately, I’ve been doing more artwork than coding, so the new openSUSE 11.4 is fully stripe-themed and (IMO) looks awesome.

I don’t use openSUSE, but that doesn’t mean I should avoid contributing to one of the best KDE experiences out there, right? :) (Ok, this ended up being a contribution even to Gnome installs which required quite a lot more work, but I don’t really mind)

Striped SAL

The additional thing that made my day was the openSUSE review on the Linux Action Show. Chris (one of the hosts) didn’t stick with the original theming, but chose to use the standard blue Stripes with the Slim Glow plasma theme. The only thing better than being the default is being a choice over the default. :)

Coding again

Well, after reaching the artwork stardom :), I decided it was the time to return to my true calling. The first thing in line were a few Lancelot bugs that needed attention, and that don’t depend on the future libplasma2 development. No new features yet – but stay tuned – there should be some soon.

Activities

The main reason I got involved in developing the activities system in the first place was to have different favourite applications, different usage statistics (files opened, browser history etc.) in different activities. It always seemed daft to have Inkscape, Gimp and similar in the appmenu when I’m doing some non-GUI C++ coding.

The thing that will be responsible for that kind of stuff is the kactivitymanagerd. It currently (4.6) only controls which activities exists (along with icons, names, running/stopped states…), and which one is currently selected.

The next big thing is making it track the user’s behaviour and things that are accessed on per-activity bases. At first the data was supposed to be stored in Nepomuk, but Sebastian raised concerns that it might slow down the database too much (needs to be tested) since it would require a vast amount of data to be stored.

The second option was to use Zeitgeist as proposed by Seif (the lead Z devel). Now that we have a usable Qt API for it, the second option became viable as well.

Since I’m not famous for betting all my money on one horse, I decided to refactor the current code to be able to handle different backends, and use the one(s) that is(are) available.

Features

Currently, the following is planned for the backends:

Nepomuk Zeitgeist
Top rated[1] files[2] per (app, activity) pair yes yes
Top rated files per application yes yes
Top rated files per activity yes yes
Files accessed on a specific date no[3] yes
  1. Rating will be automatically calculated based on usage
  2. Files, locations, web pages, contacts etc.
  3. If the tests show that Nepomuk doesn’t slow down when saving each event individually, this will be a ‘yes’

No-backend support

Naturally, if you don’t want to use Nepomuk nor Zeitgeist, you’ll not get the rating goodness. But that doesn’t mean you’ll be left out – per-activity recent documents, places etc. are still a possibility.

Ok, this was a bit longer than I expected, sorry for that :)

Activities

So, work on activities has been so overwhelming that I’ve had no time to do anything else lately (KDE-related).

Service

First, the kded module and the nepomuk service that were present in KDE SC 4.5 are no more – they are now merged into one application called kactivitymanagerd (KDE ActivityManager Dæmon). The reason behind this rewrite was to have a more stable system (no crashing kded on dbus locks etc.) and to make it easier to maintain.

Identicons

We have new identicons, fully themable. Since one picture is worth more than no picture at all, here they are:

Activity identicons

Configuration

As you can see in the screenshot above, there are two corner-actions for each activity – one to stop or delete it, and another one for configuring the name and the icon.

If you remember, the ‘old’ place for configuring the above was in the ‘desktop settings’ dialogue. It was really the wrong place – this is the activity manager, it should manage all related to them.

Confirm removalChange info

If Nepomuk is not running, changing the icon will be disabled.

Edit: The layout in the shots is not showing the whole text of the label – it has been fixed.

Smaller stuff

Few of the things above required rewriting quite big chunks of code, removing a more than few hacks and refactoring. So while all that was happening, I had the opportunity to change a few visually irritating things as well. The most important usability problem was the fact that we didn’t differentiate the current activity from the others.

UI

Templates

Others were also busy, so Chani and Mario started making the templating system for creating and sharing activities, but I’m not going to write about that – I’ll leave it to them – I’ll just post a screenshot of what the ‘Add activity’ looks like at the moment.

Add activity

That’s all for now, so long and thanks for all the squids.

First activities client application

At last Tokamak (Plasma developer sprint), I’ve made a small KWrite proof-of-concept patch just to see how it will behave with the new activities framework – notifying system when it opens and closes a document. A lot of time has passed since, and activity classes were completely revamped, turned upside-down, went through one API review, and moved from the playground to kdebase/libs.

That original patch doesn’t exist anymore, and even if it did, it wouldn’t work for all the changes that were made to activities.

The uber-awesome KDE conference – aKademy – was a time for something new!

New client

Ok, after this introduction you’d expect that I’ve written another patch for KWrite. Well, you’re wrong. The first application that supports activities as a client is Vim! :)

The main reason I went for Vim this time was to prove that non-kde apps can work with our awesome concept of activities. Another reason is that I didn’t want to use KActivity* classes, so that I can see whether the d-bus protocol is sufficiently profound for this task. It turned out that it is, but there are some improvements to be made.

At the moment, only Vim invoked from a terminal emulator program (eg Konsole) can work with activities since I can’t find a way to retrieve the window id of a GUI-enabled Vim from vimscript, so I’m essentially using WINDOWID environment variable that terminal emulators set.

The following is a debugging output of the activity manager daemon related to Vim windows

resourceWindowRegistered: 54526034 file:///home/ivan/mailacc.txt
resourceWindowUnregistered: 54526034 file:///home/ivan/.vimrc
resourceWindowRegistered: 85983274 file:///home/ivan/
resourceWindowRegistered: 85983274 file:///usr/share/vim/vim72/doc/options.txt

Truly limitless possibilities!!!

^^^^ just wanted to write an awesome marketing-speak sentence for the end of the post :D

Tokamak 4: Activities

This one will be short, I don’t really have the will for writing – it is half past midnight here.

The activities infrastructure is mostly finished – now only polishing is left to be done.

The new organization goes like this:

The core activity-related features are placed into a kded module which doesn’t depend on anything but Qt and the core kde libraries. The class for writing the clients of this service (any program that wants to be able to react to activity changes etc.) will be in kdelibs. The API is minimal and very easy to use – it took me only a couple of minutes to patch KWrite to be able to use activities.

The second part is the revamped Nepomuk Activities service (I already blogged about it – the changes made at T4 were mainly related to make it fit the new arhitecture). If it is running, the above class passes all the info to it. Running the service enables the access to extra meta-data regarding documents and activities.

The third, and last part is the manager class which will be in kdebase/workspace (most probably) because it is only intended to be used by kwin and plasma. Normal programs shouldn’t use it.

The next step is the UI – kwin and plasma

Cheerio.

Nepomuk/Plasma Activities

Unfortunately, the activities service didn’t make it into 4.4 because there wasn’t enough time for it to pass on from kdereview into kdebase. This means that it was returned to playground for further processing. :)

The service has grown a bit and now it exposes a few more methods like linking activities to other nepomuk resources (documents, places…).

KIO

Since the service is not really useful by itself (from the user’s point of view), it will need some kind of UI. The main UI will be Plasma and the ZUI replacement which will be one of the Tokamak4′s main topics.

For the time being, I made a KIO slave shown in the picture above. It lists the defined activities and the resources linked to it. At the moment, the resources are limited to Applications, Documents, Places and Contacts (I’ve just realized that those are the same sections that are in Lancelot – completely by accident).

The data shown in the picture is a garbage data I put into nepomuk for the sake of testing (no sane person would put Thumbs.db in the work-related documents. :)