By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,908 Members | 1,892 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,908 IT Pros & Developers. It's quick & easy.

Kde Taskbar

P: n/a
Hello

In linux I use kmail as my email client under KDE,
if a message comes in the Kontact button in the
taskbar changes to blue.
How can I have the same behaviour in a python app ?

I have a python script which runs nicely under linux
now every so often I want to be notified by some event,
in this case that a record has been added to a database
and I want to have the application button in the taskbar
to change color

Thanks for any pointers , I am out of my depth here

Db
Oct 7 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
DarkBlue schrieb:
Hello

In linux I use kmail as my email client under KDE,
if a message comes in the Kontact button in the
taskbar changes to blue.
How can I have the same behaviour in a python app ?

I have a python script which runs nicely under linux
now every so often I want to be notified by some event,
in this case that a record has been added to a database
and I want to have the application button in the taskbar
to change color

Thanks for any pointers , I am out of my depth here
pykde afaik supports systray-iconified apps. And you could use the
dcop-mechanisms that are available as command line tools as well I
guess, and invoke knotify.

Hope this gives you some pointers - I'm currently on my mac so I can't
provide an actual example.

Diez
Oct 7 '06 #2

P: n/a
On Saturday 07 October 2006 14:59, DarkBlue wrote:
In linux I use kmail as my email client under KDE,
if a message comes in the Kontact button in the
taskbar changes to blue.
How can I have the same behaviour in a python app ?
You need to activate the window associated with the application.
I have a python script which runs nicely under linux
now every so often I want to be notified by some event,
in this case that a record has been added to a database
and I want to have the application button in the taskbar
to change color
If the script is running in a console, you'll need to activate
the window containing the console. I tried doing this by accessing
konsole's DCOP interface, but couldn't find a suitable method to
call. If you know which konsole your script is running in, you might
find that you can raise the window with

dcop konsole-<pidkonsole-mainwindow#1 raise

where <pidis the process ID of the konsole. This might have the
effect of causing its taskbar button to change color. You can find
information about the konsole from the KONSOLE_* environment
variables.

It would be good if konsole had a DCOP method that enabled you to
activate its window, or if kicker exported an interface for the
taskbar, or even if kwin had some way of letting you activate a
window given its ID. Unfortunately, I couldn't find methods for
any of these, so you would have to think about using PyKDE to get
at this functionality.

It would be good if someone could prove me wrong on any of this. ;-)

David
Oct 7 '06 #3

P: n/a
Diez B. Roggisch wrote:
>
pykde afaik supports systray-iconified apps. And you could use the
dcop-mechanisms that are available as command line tools as well I
guess, and invoke knotify.

Hope this gives you some pointers - I'm currently on my mac so I can't
provide an actual example.

Diez
Thank you ,
a quick look at pykde tells me that
this will need some research

Db
Oct 7 '06 #4

P: n/a
David Boddie wrote:
On Saturday 07 October 2006 14:59, DarkBlue wrote:
>In linux I use kmail as my email client under KDE,
if a message comes in the Kontact button in the
taskbar changes to blue.
How can I have the same behaviour in a python app ?

You need to activate the window associated with the application.
>I have a python script which runs nicely under linux
now every so often I want to be notified by some event,
in this case that a record has been added to a database
and I want to have the application button in the taskbar
to change color

If the script is running in a console, you'll need to activate
the window containing the console. I tried doing this by accessing
konsole's DCOP interface, but couldn't find a suitable method to
call. If you know which konsole your script is running in, you might
find that you can raise the window with

dcop konsole-<pidkonsole-mainwindow#1 raise

where <pidis the process ID of the konsole. This might have the
effect of causing its taskbar button to change color. You can find
information about the konsole from the KONSOLE_* environment
variables.

It would be good if konsole had a DCOP method that enabled you to
activate its window, or if kicker exported an interface for the
taskbar, or even if kwin had some way of letting you activate a
window given its ID. Unfortunately, I couldn't find methods for
any of these, so you would have to think about using PyKDE to get
at this functionality.

It would be good if someone could prove me wrong on any of this. ;-)

David
My python app actually is a pythoncard app
which I hope will make things easier.

Db
Oct 7 '06 #5

P: n/a
On Saturday 07 October 2006 15:41, Diez B. Roggisch wrote:
pykde afaik supports systray-iconified apps. And you could use the
dcop-mechanisms that are available as command line tools as well I
guess, and invoke knotify.
I think DarkBlue wanted to affect the behaviour of the taskbar, though
a system tray icon might be a reasonable alternative.
Hope this gives you some pointers - I'm currently on my mac so I can't
provide an actual example.
I'd be interested in an example of how to use knotify via DCOP. A few
minutes at the command line looking at the DCOP interface didn't prove
particularly fruitful for me.

David
Oct 8 '06 #6

P: n/a
On Saturday 07 October 2006 16:29, DarkBlue wrote:
David Boddie wrote:
>You need to activate the window associated with the application.
[...]
My python app actually is a pythoncard app
which I hope will make things easier.
If PythonCard or its underlying API has a function for activating
windows, this _should_ do what you want.

David
Oct 8 '06 #7

P: n/a
In message <b9**************************@news.chello.no>, David Boddie
wrote:
I'd be interested in an example of how to use knotify via DCOP.
Found a tutorial here <http://lukeplant.me.uk/articles.php?id=3>.
Oct 8 '06 #8

P: n/a
On Sunday 08 October 2006 14:16, Lawrence D'Oliveiro wrote:
In message <b9**************************@news.chello.no>, David Boddie
wrote:
>I'd be interested in an example of how to use knotify via DCOP.

Found a tutorial here <http://lukeplant.me.uk/articles.php?id=3>.
Thanks for the link. Maybe the original poster can use something
from the tutorial if the window activation trick doesn't work.

David
Oct 8 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.