在Gnome Shell中显示通知

roh*_*n99 9 python gnome status python-2.7 gnome-shell

如何GNOME通过python程序发送通知?我曾尝试Python绑定类似pynotify,python-notify2,但都给予弹出通知这是暂时的.是否有任何python绑定在消息托盘上发出通知GNOME

alv*_*opg 18

您必须使用PyGObject,它允许您通过使用GObject内省访问GNOME平台.您可以在Arch文档中阅读桌面通知的示例:

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 ()
Run Code Online (Sandbox Code Playgroud)