Sunday, September 14, 2008

HOWTO: decoupling the dashboard from the desktop

(I promised someone the other day who wrote to me by email that I'd blog this little tidbit. Hopefully it also ends up in the Plasma FAQ over on Userbase.)

When you press Control + F12 when Plasma is running, the Plasma Widget Dashboard pops up for you. By default, this "brings forward" your desktop and helps address the "but I never see my desktop!" problem.

It's not the only way of working, of course, but it seems like a sensible default balancing usability concerns and resource consumption. On the Mac, they only have a dashboard view and no widgets on the desktop. Some people prefer this; others just want a completely different set of widgets on their desktop and on the dashboard.

In KDE 4.1 I snuck in a little feature for those people that lets you define what Activity to show in the desktop. (It was requested on IRC by a random user and they made their case so compellingly that I just had to add it in there. =) There is no configuration UI for it and how it works is a little complex, so I've avoided talking about it too, too much.

So here's how to take advantage of this trick, as long as you are using KDE 4.1.0 or higher:

First, zoom out on the desktop and select Add A New Activity from the toolbox. We will use this Activity for the dashboard. Now open a konsole window and do "kquitapp plasma".

Plasma consists of an in-memory representation of the items, or the scene, and one or more views on this scene. The views are what actually paint to the screen (the items just exist abstractly in the scene). Examples of views are panels, the desktop itself or in Amarok2 the Context View. Configuration for the scene and the views are kept separate to make it easier to transport around scene layouts (e.g. Activities) and to keep the distinction more clear in the code base.

The scene configuraton for the Plasma workspace shell is kept in the plasma-appletsrc file. In the plasma-appletsrc file, there will be a new entry (found most easily by looking for plugin=desktop) for this new Activity. The configuration group will be called "[Containments][#]". The number (#) is important. Write this down somewhere. We will also want the number for the usual desktop containment, record all #s from groups with plugin=desktop.

Close the plasma-appletsrc file and open up plasmarc. This is where the views for this application are stored. In there you will find a group called "[ViewIds]". Look for an entry that starts with one of the numbers we got from plasma-appletsrc. This will be the mapping of the Activity to the View, with the Activity on the left and the View on the right.

So if the Activity id was "39" and we have:

[ViewIds]
3=1
39=2

then the view we're looking for has id 2. At this point we want to look for a group in plasmarc called '[PlasmaViews][#]' (in the example above, that # would be 2). This group probably does not exist in your plasmarc (the DesktopView doesn't store much in the way of configuration data), so just add it to the file. Now add a DashboardView=# DashboardContainment=# entry, where the # is the id of the new Activity we created just before exiting Plasma.

Start Plasma again and when you hit F12 you should get not your desktop Activity, but the other one. You can add widgets to it as you normally would right from the Widget Dashboard, and now you have a slightly more Mac-like experience.

Note that this setting is per-screen, so if you have more than one monitor connected to your computer you can even have a different Activity on each screen's Widget Dashboard.

As you have probably already figured out, the configuration files are not exactly optimized for humans. ;) One day I'll get around to putting a bit of config UI into the Widget Dashboard to let you set which Activity to show and then you won't have to resort to all this text editor stuff. Or maybe someone will appear with a patch magically in hand, who knows. =)

Anyways, enjoy. Especially if you are Robert L. =)

25 comments:

David Palacio said...

Niiiiice!
I'm not Robert L. but I will more than specially enjoy this!

Thank you aseigo and Plasma team.

rocco said...

Thank you very much Aaron,

I'm in fact *that* Robert L :) I'm very pleased with this post, and this actually fulfills all the things I wanted out of plasma/dashboard. Now I can have different plasmoids on desktop and in dashboard, great! I also said something about not understanding the zoom and activity thing, but it's more that the documentation for it kinda lacks, after reading the little there is I now understand the activity thing and think it's great also! I read that it was being further enhanced in 4.2 and hopefully it will be easier to use then.

Thanks once more Aaron, you have now made me an even more happy camper in 4.1.x land.

Marcel said...

This is absolutely fantastic! Thank you and the plasma-team for the power you gave it!
If there would be a ui-configuration for that (maybe by just right-clicking on an applet and choosing between "Place at: -Desktop, -Dashboard, -Both) i would definitely write a love-poem for all of you ;-).

But i have another question:
I'm using a nvidia 7200gs and when i press the ShowDashboard button i have a duration of 2sec with a white screen until the dashboard is shown (absolutely not slightly). When i switch it off it smoothly fades out like it should be. Is this already known and is this a nvidia or kde(plasma) bug? It happens on kde4.1.1 and kde4.2svn with nvidia stable and beta drivers.

Thanks in advance and thank you again!

elvis said...

@Marcel, I think this is a known issue with the interaction between the nVidia drivers and KDE4. nNvidia is working on fixing these things in a series of BETA drivers.

I think that I have the issue as well with my 6600 GT. I can't quite remember if upgrading to the latest BETA drivers (177.70) fixed this particular issue for me, since I've been away from home for a while with only my Intel laptop (the latest drivers did fix a host of other performance problems though). Watch out for new nVidia driver releases at nVnews [1], as they seem keen on fixing the KDE4/nVidia interaction.

@aseigo: Awesome!

Regards,
Elvis

[1] http://www.nvnews.net/vbulletin/showthread.php?t=118602

elvis said...

@marcel, I forgot to say, if you try out the BETA drivers, make sure you turn the relevant performance options in [1], as they are not turned on by default (but probably will be in the final version of the driver).

Elvis

[1] http://www.nvnews.net/vbulletin/showthread.php?t=118088

elvis said...

@marcel, damn, I just saw that you said you had tried the BETA drivers :) Well I guess we can just hope for a new release from nVidia soon. I'm pretty sure I have the same issue as you. I will check when I get home to my desktop this evening. Sorry for the noise, maybe it will help someone else.

Elvis

maninalift said...

I have quite possibly not full understood this but is there any reason that one should have only one "dashboard". Could you just add the ability to associate a shortcut with any activity to bring it forward as a dashboard?

Jake T said...

Whew. My brain hurts! ;)

Obviously, there's some pretty different metaphors on here than the average 'desktop' + 'virtual desktops' ideas, what with 'views' and 'activities'.

Is there somewhere yet that explains/walks people through the new metaphors? Sounds like an interesting read ;) Thanks!

rocco said...

Robert L here again....

Only problem I have in 4.1.1 is that it doesn't work as you say Aaron.

I nuked my plasmarc,plasma-appletsrc and started over again but it doesn't work I'm afraid.

Here is my config (I removed some lines):

[Containments][1]
plugin=desktop

#the new one
[Containments][14]
plugin=desktop
screen=-1

[ViewIds]
1=2
3=1

[PlasmaViews][2]
DashboardView=14

But I get the Dashboard for the current Activity every time, independent on which I currently are on. Are you sure this made it to 4.1.1?

Aaron J. Seigo said...

@rocco: apologies; i made a typo in the blog entry and copied the wrong text from a config file; it should be DashboardContainment=14 not DashboardView=14.

i've corrected it in the blog entry as well.

*sigh*

to err is human, so i'm very obviously a human ;)

rocco said...

WHOOIIOHOO!!

Now it works great!

One good thing is that I know where every file regarding plasma source is now :)

Couldn't find DashboardView anywhere in the source, but I sure find DashboardContainment in desktopview.cpp!

Now I can go to sleep and feel happy!

Einar said...

Thanks for the tip, Aaron. This is a good candidate for the Plasma FAQ! (unless someone else beats me to it, I'll be trying to update it next weekend)

Hans said...

Oh, I just waited for this to happen. You rock! :)

I must say I like maninalift's suggestion: make it possible to associate shortcuts with Activities, and later on even individual plasmoids. Then of course we need a shortcut to raise the "current" activity.

Ivan Čukić said...

As always, I have just one word for you, well 3 words to be exact "You are insane!" :) This is sooo cool!

maninalift said...

I'm with Ivan on that one. And you have to trust anyone with a name as cool as his.

Luis Augusto said...

Oh, I filled a bug of this completely unaware of this. You're fast Aaron.

Thanks and kudos for you.

Cato said...

i don't understand the ZOOM OUT to the desktop and then what is this add new activity. can you elaborate what all this is? thanks

Marvin said...

hello!

i found this blog and definitely want to use this! i hate the solution with plasmoids on the desktop!

but i'm using kde42 and it does not work anymore! any suggestions?

thx iggy

Nate said...

Yeah, I'm with Marvin, this tutorial doesn't seem to work in 4.2. I'm a recent KDE convert and I like the idea of plasmoids but I don't want them cluttering up my desktop. Is there some new method of setting plasmoids on a layer now that 4.2 is out? How can I set this up?

Thanks
Nate

Algol said...

It doesn't work for me too, on kde 4,2

Algol said...

It doesn't work for me too, on kde 4.2
please help :)

k4in said...

I get it work for kde 4.2
follow all the steps until open plasmarc file, then you will see something like this
-------------------------
[Applet Browser]
used=,pager,systemtray,tasks,launcher,notifier,digital-clock,internal:extender,katesession,activitybar,quicklaunch,quickaccess,sm_cpu,sm_hdd,sm_hwinfo,sm_net,system-monitor_applet,sm_temperature,folderview,calendar

[KFileDialog Settings]
Height 1050=450
Recent Files[$e]=1213065222312.jpg,$HOME/Images/16-10_widescreen/Anime/1229156537832.jpg,$HOME/Images/16-10_widescreen/Anime/1213065222312.jpg
Width 1680=815

[PlasmaAppletBrowserDialog]
Height 1050=599
Width 1680=407

[PlasmaViews][2]
panelVisibility=0

[PlasmaViews][2][Sizes]
lastsize=1680

[PlasmaViews][2][Sizes][Horizontal1680]
max=1680,45
min=1680,45
offset=0
size=1680,45

[PlasmaViews][2][Sizes][Vertical1050]
max=45,1050
min=45,1050
offset=0
size=45,1050

[Theme-amarok]
name=Amarok-Mockup

[ViewIds]
13=3
3=2
----------

delete all the ViewIds and put your active desktop and the PlasmaView number you have, mine is

[ViewIds]
38=2

to finish write DashboardContainment=#
where # is your new activity, below [PlasmaViews][2] (remember that 2 will be the PlasmaView you already have), like

[PlasmaViews][2]
DashboardContainment=44
panelVisibility=0

start plasma again and that's it, at the end you'll have something like this
------------------
[Applet Browser]
used=,pager,systemtray,tasks,launcher,notifier,digital-clock,internal:extender,katesession,activitybar,quicklaunch,quickaccess,sm_cpu,sm_hdd,sm_hwinfo,sm_net,system-monitor_applet,sm_temperature,folderview,calendar

[KFileDialog Settings]
Height 1050=450
Recent Files[$e]=1213065222312.jpg,$HOME/Images/16-10_widescreen/Anime/1229156537832.jpg,$HOME/Images/16-10_widescreen/Anime/1213065222312.jpg
Width 1680=815

[PlasmaAppletBrowserDialog]
Height 1050=599
Width 1680=407

[PlasmaViews][1]
panelVisibility=0

[PlasmaViews][2]
DashboardContainment=44
panelVisibility=0

[PlasmaViews][2][Sizes]
lastsize=1680

[PlasmaViews][2][Sizes][Horizontal1680]
max=1680,45
min=1680,45
offset=0
size=1680,45

[PlasmaViews][2][Sizes][Vertical1050]
max=45,1050
min=45,1050
offset=0
size=45,1050

[Theme-amarok]
name=Amarok-Mockup

[ViewIds]
38=2
-------------------
enjoy your separate dashboard
sorry for my bad english

AJ said...

hey aaron , i could clearly make out what to do here , but the problem i faced was this , when i added a new activity there should have been a new group with plugin=desktop other than the original one for the older one. Now that wasnt there. What noob mistake might i be making cos i checked the plasma-appletsrc file before and after the creation of new activity and it was the same for me. What do i do???

Im sure the location of the file is /root/.kde/share/config/plasma-appletsrc

Jim said...

I'm with the other user that doesn't understand ZOOM OUT to the desktop. What exactly does that mean?

Thanks,
Jim.

zorrito said...

really awesome
i love kde4 even if there are still much bugs, thank you for your explanation

michele