def startup_notification(name, desc=None, bin_name=None, icon=None): dpy = gtk.gdk.display_get_default() screen = dpy.get_default_screen().get_number() sn = sn_launcher(dpy, screen) sn.set_name(name) if bin_name: sn.set_binary_name(bin_name) if icon: sn.set_icon_name(icon) if desc: sn.set_description(desc) sn.initiate("", "", gtk.get_current_event_time()) return sn
def startup_notification(name, desc=None, bin_name=None, icon=None): dpy = Gdk.Display.get_default() #FIXME this will work with GTK3 #screen = dpy.get_default_screen().get_number() screen = Gdk.Screen.get_default().get_number() sn = sn_launcher(dpy, screen) sn.set_name(name) if bin_name: sn.set_binary_name(bin_name.encode('UTF-8')) if icon: sn.set_icon_name(icon.encode('UTF-8')) if desc: sn.set_description(desc.encode('UTF-8')) sn.initiate("", "", Gtk.get_current_event_time()) return sn