Kde Taskbar

D

DarkBlue

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
 
D

Diez B. Roggisch

DarkBlue said:
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
 
D

David Boddie

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-<pid> konsole-mainwindow#1 raise

where <pid> is 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
 
D

DarkBlue

Diez said:
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
 
D

DarkBlue

David said:
You need to activate the window associated with the application.


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-<pid> konsole-mainwindow#1 raise

where <pid> is 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
 
D

David Boddie

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
 
D

David Boddie

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,163
Latest member
Sasha15427
Top