February 4, 2011 — Hans

Ever since the introduction of the activity concept in KDE Plasma Workspaces, it has caused confusion to many people. To spread some inspiration I wrote a blog post some time ago with examples of how I used activities. It ended up, much to my surprise, to be one of my most popular posts. This seemed to suggest that many still didn’t know what to use activities for.

Back then I often explained activities as ‘similar to virtual desktops, which are groups of windows, but instead activities are groups of desktop widgets’. However, in 4.6 they have evolved past this stage – now windows are also associated with activities. Therefore I wanted to write a blog post about the current state of activities, but someone beat me to it; a few days ago Jason Lim Yuen Hoe posted a very nice article on activities that brought up most of the points I planned to talk about. I found that the post reflected my own thoughts very well, and if you haven’t read it yet, I recommend giving it a read.

In this post I’ll instead write about my personal vision of how I hope activities will change my workflow. It’s based on my own experience and what I’ve read about activities. Note that it doesn’t necessarily coincide with the vision of the Plasma team, but if there are any inconsistencies I would appreciate if a Plasma developer could point them out in a comment below.

After reading this I hope that you will get a better understanding of what activities are and start to think about how you can benefit from them. I will also try to answer the frequently asked question “Why should I use activities instead of virtual desktops?” and explain when I think you should use what.

Translations: Portuguese | Russian

How can activities be useful?

Let’s start from the very beginning and ask ourselves “Why do we need activities?”. Many are already familiar with the concept of virtual desktops and use them in a similar way to activities, which makes things more complicated. For that reason I will take the easy route here and assume that virtual desktops don’t exist. While reading you might start to think “Hey! That’s what virtual desktops are for!”, but try to ignore it – I’ll come back to them later.

So for the sake of understanding, let’s forget about virtual desktops for now. Poof. Gone.

Remember this guy? Well, you shouldn’t by now



The problem

Most of us use our computers for several different tasks, such as playing games, writing reports, creating graphics and web development. I’m sure you can think of more examples.

For some of the tasks you only need one application. If you want to play a game you start the game and play until you decide to do something else, at which point you close the game. It’s as simple as that.

In the case when one task equals one window it’s easy to keep things organized – when you want to switch task you just need to switch to the right window in the taskbar or start a new application. However, most of us have tasks that require more than one application, and then things start to get messy. In that case we want to use the taskbar to switch between windows for the current task, but it will also show windows that we aren’t interested in at the moment. An example of this is shown in the screenshot below. I started out by working on a report, but after a while I decided to take a break and code a bit on a spreadsheet application. This is only two tasks, but you can see how quickly the taskbar becomes a mess.

Screenshot showing a somewhat cluttered workspace (I’ve seen worse)



So why don’t we just close all unused windows? That’s indeed what many people do, but it requires you to manually close and open applications every time you want to switch task. In addition to that, you have to open the files you want to work with and sometimes rearrange the new windows. This makes switching between tasks time consuming and cumbersome.

A quick word about session management

Some applications support sessions, which is great. Sessions allow you to save a particular state of an application and restore it later. For example, I can open all my source code files in Kate and save it as a session. When I feel like coding again I just need to launch Kate, open my “coding” session and voilà – the application state is as I left it the last time, with all my files open.

KDE Workspaces have supported sessions for a long time, but it has always been on a very basic level. By default it restores the previous session (i.e. the state of your workspace last time you logged out), but you can also set it to restore a manually saved session. It is however limited to one session (Bug 62157), so you can’t have one session for coding, one for editing videos etc.

How activities can change the workflow

Traditionally we start applications and switch between them with the taskbar. As said, this works well if we only have one window per task.

For tasks that require more than one application, instead of starting each application individually we rather want to start a new “session”. One click and everything is set up – the applications are started with the right files open, windows are ordered in the way we prefer and everything belonging to other tasks get out of the way. Switching task should be a simple matter of switching “session”.

Feeling like coding for a bit? Just start the Coding “session”

Yes, what I’m describing is how I hope activities in KDE Plasma Workspaces will work. But what if the applications in your activity vary a lot – for example, you don’t know in beforehand which game you want to play in your Gaming activity. In this case we don’t want to restore any windows.

The thing is, the concept of activities is not limited to windows, it involves your whole workspace. When switching to your Gaming activity you might not want to restore any applications, but you can set your desktop to show shortcuts to your favorite games. Your application launcher will be populated with gaming-related software and your contact list will show your gaming buddies first etc.

How a gaming activity could look like with shortcuts to 13(!) games

In short, activities make it easier to resume your task and to focus on it. It’s not a way to organize windows – if you find yourself switching between two windows frequently, they probably belong to the same activity, or you’re not concentrating on your current task. Furthermore, with activities it’s effortless to switch between different tasks. You only need to set up an activity once, when you start it later the previous state will be restored and you can start working right away.

Activities versus virtual desktops

I hope I’ve convinced most of you why we need something like activities. The next question is then naturally “We already have virtual desktops, what additional benefits do activities provide?”.

Earlier I talked about the problem with how quickly your workspace gets cluttered when you do several tasks that require many windows. There have been different attempts to solve this, for example by grouping tasks in the taskbar. Virtual desktops allow you to organize your windows in a certain way and only show the group of windows you’re interested in. At first it might sound a lot like what activities do, but I personally think that they are fundamentally different.

First of all, I see virtual desktops as a way to organize windows and nothing more. It’s a nice feature when you have many windows to work with. Activities, on the other hand, is more like a session manager. Not only can you save and restore states of your workspace (this is already possible to some degree with virtual desktops and the current session manager in KDE Workspaces), you can also stop activities if you find that they take too much computer resources.

Stop resource-intensive activities that you don’t need at the moment

I’ve never quite managed to use virtual desktops to divide my tasks, although I know that some people do it. To continue with my example of writing a report and coding – sure, I could move all windows related to coding to a separate virtual desktop. But what about my music player? I want to listen to music when I’m working on my report and when I’m coding, so which virtual desktop does it belong to? I usually find myself putting it on a separate virtual desktop.

With activities you can associate a particular window with more than one activity. You should have everything you need for a certain task in an activity, which eliminates the need to switch back and forth between activities (unless you really want to switch task). In the example with the music player I would associate it with both my coding and my report writing activity.

There are other limitations of virtual desktops that make it clear that they were created for a different reason than activities. In earlier versions of Plasma Workspaces you had a fixed number of virtual desktops that you could change, but in recent versions it is possible to add and remove virtual desktops “on the fly”. What happens is that the number of virtual desktops is increased or decreased by 1. This may not sound that bad, until you realize that it always removes the last virtual desktop. It’s probably possible to hack around this, but as far as I understand it’s not that trivial.

Finally, as I said before, activities are not only about windows. In 4.6 only your desktop and windows are affected by switching activity, but in future versions more applications will be activity aware. Such applications can be customized to prioritize showing information that are relevant for your current activity. Here are some ideas of what it could be:

Favorites in the application launcher

Entries in the Places sidebar in Dolphin and open/save dialogs

File search results (showing relevant files/folders first)

Bookmarks in your web browser

Contact list in Kopete

News feeds in Akregator

Are activities unintuitive?

Some people claim that activities are unintuitive and hard to understand. I agree to a certain degree since activities are under heavy development, but I believe that the concept (at least the one described here) is generally easier to understand than virtual desktops.

I’ve seen many new Linux users (using “Linux” as a very broad term here) point and ask what those two/four squares in the panel are. Someone will answer that those are virtual desktops, which further confuses the new users. What are virtual desktops? Even after an explanation most users I’ve observed don’t seem to understand what to use virtual desktops for.

Desktop effects such as the famous cube and desktop grid help a lot, since they make it easier to visualize what virtual desktops are and what happens to your windows when you switch desktop.

If someone asks me what an activity is, I want to be able to have the following conversation:

Me: “So, what activity are you doing at the moment?”

Guy: “I’m analyzing data for a study.”

Me: “So, this is your ‘Analyzing data’ activity. [Explains how to rename an activity.] When you want to do something else, don’t close anything – you can leave it as it is. Just switch to a new activity.”

Guy: “So now I’ve created a new activity and started to write on my report. Is this my ‘Writing report’ activity?”

Me: “That’s right.”

Guy: “Geez, I’m out of ideas on what to write, maybe I should do some more analyzing. Now where did I put that file…”

Me: “No need to search, just switch back to your analyzing data activity!”

Guy: 😀

So are virtual desktops redundant now?

I don’t think so. There will be people who want to organize the windows within a single activity, and this is what virtual desktops should be used for.

I’m on the same track as Jason (the author of the article I linked to in the beginning) here – if you use virtual desktops to separate windows for different tasks, you might want to switch to activities in the future with only one virtual desktop. However, if you want to group certain windows in a single activity, you can use virtual desktops. Finally, if you only do one task on your computer one activity might be enough, and virtual desktops can be used to organize your windows.

There is an option to associate activities with virtual desktops (it’s still called “Different widgets for each desktop” in 4.6). Personally I think it just makes things more confusing by merging the two concepts – the only benefit I see now is that it makes it easier to switch activity and move windows between activities by using methods intended for controlling virtual desktops. As activities mature further I hope that this option becomes unnecessary.

Closing words

In this post I’ve talked about my interpretation of activities and how I wish to use them. I want to remind you that what I’ve written here is not official, it’s my personal vision. It is, however, based on the current state of activities and what I’ve read about them, so hopefully the description here isn’t too far from what will become reality.

I’m still experimenting with activities, but I think they need to mature a bit before I can completely change to the new workflow described here. Having said that, I like what I see in 4.6 and I’m excited to discover the state of activities in 4.7.

I sometimes hear people complain that it’s too hard to change activity, so in my next article I plan to write about the methods I know to switch between them. Meanwhile, have fun with your activities, I hope this post has been useful to you.