2
import dbus, gobject, dbus.glib, os, sys
5
notifier = dbus.Interface(dbus.SessionBus().get_object(
6
"org.freedesktop.Notifications", "/org/freedesktop/Notifications"),
7
"org.freedesktop.Notifications")
9
def notify(title, text, icon = None, actions = [], timer = 9000):
10
return notifier.Notify("Gwibber", 0, icon, title, text, actions, {}, timer)
18
SPELLCHECK_ENABLED = True
20
SPELLCHECK_ENABLED = False
24
def load_url(url): gnome.url_show(url)
26
def load_url(url): os.system("xdg-open %s" % url)
28
def service_is_running(name):
29
return name in dbus.Interface(dbus.SessionBus().get_object(
30
"org.freedesktop.DBus", "/org/freedesktop/DBus"),
31
"org.freedesktop.DBus").ListNames()
33
def create_tomboy_note(text, display = True):
34
obj = dbus.SessionBus().get_object("org.gnome.Tomboy", "/org/gnome/Tomboy/RemoteControl")
35
tomboy = dbus.Interface(obj, "org.gnome.Tomboy.RemoteControl")
37
n = tomboy.CreateNote()
38
tomboy.SetNoteContents(n, text)
39
if display: tomboy.DisplayNote(n)
41
def set_pidgin_status_text(message):
42
bus = dbus.SessionBus()
43
obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
44
purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
46
current = purple.PurpleSavedstatusGetType(purple.PurpleSavedstatusGetCurrent())
47
status = purple.PurpleSavedstatusNew("", current)
48
purple.PurpleSavedstatusSetMessage(status, message)
49
purple.PurpleSavedstatusActivate(status)