- #!/usr/bin/env python
- import gi
- from gi.repository import Unity, Gio, GObject, Dbusmenu
- loop = GObject.MainLoop()
- # Pretend to be evolution for the sake of the example
- launcher = Unity.LauncherEntry.get_for_desktop_id ("evolution.desktop")
- # Show a count of 124 on the icon
- launcher.set_property("count", 124)
- launcher.set_property("count_visible", False)
- # Set progress to 42% done
- launcher.set_property("progress", 0.42)
- launcher.set_property("progress_visible", True)
- # We also want a quicklist
- ql = Dbusmenu.Menuitem.new ()
- item1 = Dbusmenu.Menuitem.new ()
- item1.property_set (Dbusmenu.MENUITEM_PROP_LABEL, "Item 1")
- item1.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, True)
- item2 = Dbusmenu.Menuitem.new ()
- item2.property_set (Dbusmenu.MENUITEM_PROP_LABEL, "Item 2")
- item2.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, True)
- ql.child_append (item1)
- ql.child_append (item2)
- launcher.set_property("quicklist", ql)
- def update_urgency():
- if launcher.get_property("urgent"):
- print "Removing urgent flag"
- launcher.set_property("urgent", False)
- else:
- print "setting urgent flag"
- launcher.set_property("urgent", True)
- return True
- GObject.timeout_add_seconds(5, update_urgency)
- loop.run()
de hecho no he conseguido ni ejecutar el codigo python me da error................para gambas he intentado :
pero no funciona alguna idea.....