After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 507924 - Notification Icon click event and context menu
Notification Icon click event and context menu
Status: RESOLVED DUPLICATE of bug 310001
Product: zenity
Classification: Core
Component: general
2.20.x
Other All
: Normal enhancement
: ---
Assigned To: Zenity Maintainers
Zenity Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-01-07 20:54 UTC by Aurélio A. Heckert
Modified: 2008-04-19 20:11 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Aurélio A. Heckert 2008-01-07 20:54:10 UTC
The zenity --notification do not give simple interaction possibilities.

Can be very useful if a left mouse click on the icon calls some command.
Will be very useful too if a right mouse click opens a context menu.


Setting event handle proposal:
zenity --notification --onclick="<some sh code>"

Example:
zenity --notification --onclick="zenity --info --text='You click me!'"

This will call a external program and can be good fo the most things
what i think, but if we need to call a interna function we can do this:

trap internalFunction 50
function internalFunction() {
  zenity --info --text="You click me!"
}
zenity --notification --onclick="kill -s 50 $$"


Setting a context menu proposal:
must be added and can be modified on the fly using --listen.
add-menu-item:<icon path|none>|<item name>|<some sh code>
add-menu-separator
remove-menu-item:<item name>

Example:
echo "
add-menu-item:bli.png|Say Bli!|zenity --info --text='Bli!'
add-menu-item:|open my picture|eog ~/$USER.jpg
add-menu-separator
add-menu-item:about.png|About|zenity --info --text='This is an Example'
"
zenity --notification --listen
Comment 1 Skippy le Grand Gourou 2008-01-18 22:00:10 UTC
I strongly agree. BTW, isn't it a clone of #310001 ?
Comment 2 Aurélio A. Heckert 2008-02-20 18:08:11 UTC
Yes! Sory... but i put some extra ideas hire, that may be useful. :-)
Comment 3 Tom Tromey 2008-04-19 20:11:40 UTC
I'm closing this as a duplicate.
I think the patch in #310001 already does most of what you want.
Also I think it is preferable to discuss it in one place.

*** This bug has been marked as a duplicate of 310001 ***