Display notifications in Gnome Shell

How can I send notifications to GNOME via python program? I tried python bindings like pynotify , python-notify2 , but all provide pop-up notifications, which are temporary. Are there any python bindings for notification in the message tray in GNOME ?

+9
source share
2 answers

You should use PyGObject , which gives you access to the GNOME platform using GObject introspection. You can read the example in the Arch documentation for desktop notifications :

 from gi.repository import Notify Notify.init ("Hello world") Hello=Notify.Notification.new ("Hello world", "This is an example notification.", "dialog-information") # Hello.set_timeout(0) Hello.show () 

A timeout value of 0 makes it constant (until the mouse is moved). For more information, refer to the PyGObject API Reference .

+18
source

In GNOME 3, the message tray is located below and nowhere else. Look at extension to change location notifications.

-1
source

All Articles