Friday, January 16, 2009

today's tip: turning off the fancy schmancy notifications in the panel

If you are one of those people who would like their old notifications and/or download windows back, have no fear. Plasma is not greedy.

First, stop plasma with `kquitapp plasma`. Then open up `kde4-config --localprefix`/share/config/plasma-appletsrc and put this somewhere in there:


[AppletGlobals][plasma_applet_systemtray]
ShowJobs=false
ShowNotifications=false


Start Plasma again and voila.

If you're looking for a nice easy job to slide into Plasma or KDE development with, we need a configuration dialog done up for that. Two checkboxes and add it to the config dialog in Applet::createConfigurationInterface(KConfigDialog *parent) in kdebase/workspace/plasma/applets/systemtray/ui/applet.cpp. Easy peasy, and you'll make 4.3 that much nicer.

Update: A patch for this has already shown up on the plasma devel list. Nice..

Also, if you'd like to try your hand at some completely different way to show notifications or jobs in Plasma (or both!), the system tray uses the applicationsjobs and notifications DataEngines and so can you. Hook into either or both of those engines and all you have to care about is the presentation.

Enjoy. =)

11 comments:

rocco said...

Is it somehow possible to configure what plasma is showing in these notifications? Example: Kmail notification is showing "1 new mail as arrive in account" and I would like it to show "1 new mail with subject: KDE rocks" instead, but I guess it's up to each app to provide this?

AhmedG. said...

Very nice, though I wasn't able to get it to work using kde4-config . I got a permission denied error. I'm not quite sure what that is about but it happened on Fedora 10 and Kubuntu. Both were using kde4.2rc1.

`kde4-config --localprefix`/share/config/plasma-appletrc

issues the following error:
bash: /home/ag/.kde//share/config/plasma-appletrc: No such file or directory


changing that to
$`kde4-config --localprefix`share/config/plasma-appletrc
gives me:

bash: /home/ag/.kde/share/config/plasma-appletrc: No such file or directory

emphasis mine. What is going on there?
When I manually edited the file using kate it worked (though I'm not sure how "clean" of a solution this is).

Also, I'd be interested in working on that dialog though I wouldn't quite know how to start. (The extent of my experience with kde programming so far has been modifying a local copy of kollision to be more difficult, but I would like to start working on small pieces of kde itself for starters). The things I am confused about are

1. Where are these options going into the systemtray's configuration dialog? Or the Notifications dialog in systemsettings?

2. Am I parsing the plasma-appletsrc file and checking for these options or is there some sort of interface for this that I am completely unaware of (which I think is more likely).

3. Is this basically going to be a patch for the applet.cpp file? (I don't have svn write access)

I have been browsing the code in

http://websvn.kde.org/trunk/KDE/kdebase/workspace/plasma/applets/systemtray

and it's starting to make more sense but perhaps there are areas (docs/tutorias/people) where I can go to get a better handle on this.

If I do end up working on this it probably won't be until early February due to some tests I have to take in the coming weeks. But as you can see I know very little about programming directly into kde (most of the things I have worked on have been using just Qt and I have had to write everything from the bottom up so I am not as familiar with working on code started by others though I am determined to change that by finally contributing back to kde).

In any case if this hasn't yet been done and if it is something you think I should start by working on or if you have any advice as to where I should jump-in to kde development please email me at zrchrn@gmail.com (same as the email linked to this profile).

AhmedG.

MB said...

I am working on that already.

Aaron J. Seigo said...

`kde4-config --localprefix`share/config/plasma-appletrc

not plasma-appletrc, but plasma-applet*s*rc

MB said...

Btw, it seems that this is not really as easy as it seems. At least I wasn't able to figure out a way to disable and re-enable jobs/notifications without restarting the systray applet.

To get the old-style notifications/progress windows back, it seems that requires to unregister the relevant *protocols, but the manager does not offer such a method.

MB said...

Seems I was too slow for this one... if you have more such newbie jobs, post them please.

AhmedG. said...

@ aaron

`kde4-config --localprefix`share/config/plasma-appletsrc

bash: /home/ag/.kde/share/config/plasma-appletsrc: Permission denied


@MB
Ah well, I'll find other things to do.
Though I would still like to follow along the work to see how it was done.

John said...

@AhmedG.:

You were supposed to edit the file
`kde4-config --localprefix`/share/config/plasma-appletsrc, not run it

AhmedG. said...

@John
Thank you for clearing that up for me. I did edit it manuallay after about 2 tries of the command. I just (for some reason) expected this to bring up it's own interface or something. Thanks to you and aaron for the information. Please forgive the lack of knowledge wrt kde4-config

Barry said...

Thanks, that fix worked for me first time no problem.

xabier said...

Thanks for the tip, worked perfectly for me too. First I also thought that 'kde4-config' was suppossed to call up a configuration editor, but then I figured it was just a matter of locating 'plasma-appletsrc' file and editing it--adding the new lines.