← Back to team overview

unity-dev team mailing list archive

Re: [Ayatana-dev] Is there any way to 'hook' the messaging menu?

 

2011/7/8 Nathan Osman <george_edison55@xxxxxxxxxxx>:
> I'm basically just reposting what I wrote here:
> I would like to write an application that receives a notification whenever
> the messaging menu is activated (the blue envelope lights up) and whenever
> it is deactivated (the blue envelope returns to its default color).
> Is there any way to get a notification for this? I'm not really concerned
> about programming language in this case - although C, Python, or PHP would
> be preferred.

2011/7/8 Nathan Osman <george_edison55@xxxxxxxxxxx>:
> I'm basically just reposting what I wrote here:
> I would like to write an application that receives a notification whenever
> the messaging menu is activated (the blue envelope lights up) and whenever
> it is deactivated (the blue envelope returns to its default color).
> Is there any way to get a notification for this? I'm not really concerned
> about programming language in this case - although C, Python, or PHP would
> be preferred.

You can simply use libindicate that has multiple bindings, watching
for the property "draw-attention".
See the examples in the libindicate sources (especially
listen-and-print.{py,c}).

However you can also avoid any strict dependency on it using plain
DBus, you just need to watch for signals the bus
com.canonical.indicator.messages at path
/com/canonical/indicator/messages/service while the interface is
com.canonical.indicator.messages.service.
A simple Vala example using DBus for this, is at [2].

[1] http://go.3v1n0.net/p5HIqv
[2] http://go.3v1n0.net/mQdbU7

-- 
Treviño's World - Life and Linux
http://www.3v1n0.net



References