So having been kept away from KDE-land for some while, I innocently but excitedly pushed the upgrade button when I saw that 4.6 was out, and ran immediately smack into the huge forward leap that plasma activities has made this release. I have always been a big fan of activities and this is really exciting stuff for me, so I made a quick visit down to Chani’s blog for a quick-tour of what’s new and what’s good, but while I personally found her screencasts illuminating, a quick skim through the blog comments quickly revealed that many people remain more perplexed about activities than ever.
I’m gonna spend some hours on the keyboard here and see if I can fix some of that :)
Firstly, the usual disclaimer: I’m neither developer nor designer of the activity mechanism, just someone who has been regularly using activities – and liking them immensely – since the 4.1 days. The overview I’m gonna give below is based on my own understanding and experience using activities, so I won’t guarantee they’re all correct. Chani or the other Plasma devs are naturally welcome to come correct me if I make any mistakes.
What are Plasma Activities
I think we’ve all heard what plasma activities “are”, in some way or another before, but for completeness let me do a round of that here. Here’s the background: we all use our computers for different kinds of things, and you’d rarely find a person that only ever does one ‘activity’ on the computer. Let’s call these things we do on computers “computing activities”. Examples of common computing activities include social networking, researching for and writing a report, compiling statistics, drafting a school project essay, developing a program, and editting photos. Commonly, we get on the computer intending to perform a few of these computing activities, and what happens is that there is an inevitably necessary “context-switch” that we need to effect in some way or another in order to move from one activity to the other – since the tools, files and windows involved in the different activities are almost guaranteed to vary.
On a high-level perspective, plasma activities are meant to be associated with these computing activities, with one computing activity being associated to one or more plasma activities. So you’d want to have one plasma activity for writing a program, and another for preparing your data report, and another for enjoying multimedia. Fundamentally, a plasma activity is meant to be a contextual encapsulation that tries to maintain as much contextual information about a computing activity as possible, while at the same time exposing as many relevant tools and functionalities as possible and keeping the irrelevant ones out of sight.
So the way it should go is this: when you are researching for a report you would be on one plasma activity, and it should contain as much of the stuff you’d need when doing that as possible while hiding away games and video players and such, and then when you get bored and decide to download and sort/edit through the photos from your camera, you would also correspondingly switch to the appropriate plasma activity, which should throw out all your spreadsheets and references and bring out the likes of digiKam.
The Current State of Plasma Activities
Traditionally (ie pre-4.6), plasma has done this by, effectively, providing customizable sets of desktop widgets that can be swapped in and out. So that a statistics-compilation activity will simply be a collection of plasma applets that help you with that task, consisting of say quick-access widgets to your data and perhaps a calculator applet of sorts. Likewise a software development activity may contain folderviews to your source code folders and quick-links to online api docs. You effectively get customized desktops (desktop as in the stuff behind all your windows) for each activity you want to perform. Some real examples of such plasma activities, complete with screenshots, can be found here, here, and here.
With 4.6, plasma takes activities one step further by allowing windows to be associated with activities. Windows associated with a particular activity are only visible when you switch to that activity. So now what should become possible is this: switching from a schoolwork activity to a blogging activity does not only throw out all the schoolwork related applets and bring out the blogging related ones, it also hides away all your schoolwork word processor windows and brings out your blogging client or web browser. Instant, near-complete context switching.
The Use Case
A key question I keep hearing over and over again regarding plasma activities is – what’s it for, how does it make my life more convenient? Many people appear to think that activities are somewhat neat but too complicated and don’t actually address a real need. Along those lines, though I should already have hinted heavily at most of these before, let me spend a couple of paragraphs detailing use case and see if that might make things any clearer.
Imagine again that typical scenario – you are writing, say, a science paper, and after awhile your head starts spinning and you decide you can’t do this anymore, and decide to take a break on a more leisurely activity – sorting through the tonne of photos from your latest vacation, filtering, organising and editing them. A context switch becomes necessary – you don’t want all your paper writing stuff on the screen anymore and you want your photos and image software up. How do people traditionally perform this context switch? From my observation people usually go about this in one of two ways:
The minimizing spree. Some people simply start minimizing everything – the word processor with the half-finished paper, the web browsers with related material, the pdf readers with the related works – all goes down to the taskbar, and then they open their photos folder, open their favourite photo management tool, and get to work. When they decide they want to watch some videos or listen to some music next, they repeat – all the photo stuff goes to the taskbar, and out comes the music players. The advantage of this is that all your windows remain open, and you can resume a previous task by simply picking out all the windows from your taskbar. The disadvantage is that your taskbar becomes a monster very quickly, and window management within each individual task eventually becomes an irritating nightmare. Notably, the taskbar redesign in Windows 7 appears to be tailored to better support this mode of operation.
The clean slate. Some people (or their computers) simply cannot take that kind of massive clutter, so they actually kill everything related to the previous activity to get back to a clean desktop before setting out on the next task. So context switching involves save-kill-save-kill-save-kill-start-start-start. This way you always have relatively small numbers of windows and a relatively clean taskbar, but context-switching becomes time consuming because you always need to restart all your programs, reopen all your files, and re-point your file managers to the correct directories.
Here’s where plasma activities come to the rescue. Configured right, you should simply need to switch from your “write report” activity to your “manage photos” activity, and all the context switching should be dealt with automatically. All your word processors and browsers should be gone – from both your workspace and your taskbar – and all your photo equipment should appear, instantly. And if you want to stop and listen to music, change activities again, and all your photo stuff disappears and you get a clean workspace with only media stuff. What’s more, when you switch back to your photo activity everything reappears as it was and you can continue precisely where you left of. In effect, you get the best of both worlds with plasma activities. Computer growing slow from having too many hidden windows? The stop button on the activity panel let’s you “stop” the activities you’re not working on, which kills all its associated windows. You can later resume the activity, and all the killed windows will be restarted with their original files/urls/locations. Pretty magical stuff really!
In the end plasma activities are all about context switching. As long as you work on very different things on your computer, and each thing is complicated enough to require a critical number of windows open, there’ll always be room where plasma activities can help you when you need to switch between them.
What about Virtual Desktops?
I deliberately left out virtual desktops above because I think it deserves a section on it’s own. The other set of questions you always hear being asked about plasma activities is “can’t you do the same with virtual desktops?” or “Can’t you just fix/improve virtual desktops to do all that instead of introducing this new thing and creating conceptual clutter?”. I think a core reason why such questions arise is because many people have traditionally been using virtual desktops as context switchers. It is not uncommon for people to name their virtual desktops with such names as “work”, “leisure” or “web” – precisely the sort of names activity users would use to name their activities. So it does make an interesting question: why not just refit and refurnish virtual desktops, that everyone is already used to, and make them more “activity enabled”? Why have virtual desktops and activities?
There are two important reasons I think. The first is technical, as Chani noted in some of her comment responses. As I understand it, virtual desktops are an old, estabilished and time-honored idea, and they’ve been around so long that applications have been written that assume the standard behavior for virtual desktops, for example, that a window can only be on one desktop or on all of them. Since we don’t control these applications and don’t even know all of them, making changes to the way virtual desktops work without causing breakage to any of these existing applications becomes a sticky engineering problem. It’s probably not an unsolvable problem, but I think there is another, more intuitive reason why virtual desktops and activities should not be combined.
To understand this, we need to make a distinction between “spatial” and “contextual”. Virtual desktops are spatial – they give you more space to put your windows. Adding a new virtual desktop is not unlike plugging in a new monitor or adding a desk to your office workspace – you can have more stuff out at the same time and be less cluttered because there is more space to contain those stuff. Virtual desktops aren’t necessarily contextual – I can have a bunch of windows all related to the same computing activity strewn across various virtual desktops, just like I can have documents about a single task strewn across all my desks. This is a perfectly valid way to use virtual desktops, and it is non-contextual – it doesn’t help me divide between activities nor make context switching any easier. Of course, I can if I want exercise some discipline and confine all the windows of one particular task to one particular desktop, so each desktop represents a different task. But then I’d be harnessing the spatial enhancements that virtual desktops provide to create some semblance of contextual grouping.
Having a single concept – virtual desktops – balance both space and context may be a little awkward. Obviously it can work – we never had a choice anyway before plasma activities came along, but now that they have we can begin clearly separating the spatial from the contextual, and thus work towards a more optimized treatment of both. Under the new paradigm virtual desktops should deal solely with the spatial and activities should take over dealing with the contextual. After all, between the associating of custom widget sets to each activity, the ability to stop and resume activities, and the ability to associate windows with as many (or as few) activities as one wants, the plasma devs are working hard to make activities better at contextual management than virtual desktops ever were. So here’s the idea: if you have always only needed one desktop for each of your tasks and have been habitually using virtual desktops to divide your activities, under the plasma way you should really be having only one virtual desktop with multiple activities. If you only ever do one complex thing on your computer, then you should have one activity and many virtual desktops (which simply reduces to the old pre-activity days). And finally, if you are like me and have many different things to do, and would like a lot of space to do each of them, then you can have multiple activities and multiple virtual desktops, with the activities doing the contextual dividing and the virtual desktops simply providing extra space – for each.
I should carefully note that I’m in part talking vision here. Most of the new plasma activity features are quite rough around the edges as of 4.6, and using them fully as I have described may take some effort and patience. There are a number of issues I have discovered from my experimenting. Most notably, non-kde apps don’t fit too well into the picture – they often don’t manage to open with the correct item loaded when coming alive with a resuming activity, and don’t actually get closed when stopping the activity they belong to. Also, window-activity association support is pretty skeletal at the moment, severely lacking in stuff like keyboard shortcuts and easy ways of throwing windows to other activities. You can’t even set window rules related to activity association from systemsettings. It is a new feature after all, and most of these will doubtlessly be eventually dealt with.
Remember that it is compulsory neither to use activities nor virtual desktops. You are welcome to use whichever one helps you, and leave any or both alone if they don’t. I think it’s cool either way that free software isn’t simply seeking to emulate the well accepted paradigms of desktop usage, but are pursuing new ideas and pushing into new grounds. Evolution and progress could hardly happen without taking some risks and taking steps out of the comfort zone. Personally, I’m excited about where we’ll end up next.