I'd like to (programatically) access results from Ubuntu's heads-up display (HUD) menu service under GNOME 3.6. I've been playing around with the DBus interface for the HUD with some success, but can't get it to work outside of Unity. For example, the following Python script will show some results when run from the terminal when logged in under Unity:
#!/usr/bin/env python
import dbus
session_bus = dbus.SessionBus()
proxy_obj = session_bus.get_object('com.canonical.hud', '/com/canonical/hud')
hud_iface = dbus.Interface(proxy_obj, dbus_interface='com.canonical.hud')
query_result = hud_iface.StartQuery("ope", 5)
for res in query_result[1]:
print res[0].encode('utf8')
hud_iface.CloseQuery(query_result[2])
Running it under Unity (in 12.10) I get:
$ ./hud.py
File > <b>Open</b> Tab
File > <b>Open</b> Terminal
dropbox > <b>Open</b> Dropbox Folder
View > Zoom <b>Out</b>
Terminal > Set Character Encoding > Add <b>or</b> Remove…
...but under GNOME 3.6 I don't get any results (no errors, nothing).
It looks like these services are involved, since they are running constantly under Unity but not GNOME:
/usr/lib/indicator-appmenu/hud-service
/usr/lib/x86_64-linux-gnu/indicator-application-service
/usr/lib/indicator-(whatever)/indicator-(whatever)-service
But if I start them up under GNOME, they exit soon after with
$ /usr/lib/indicator-session/indicator-session-service
(process:4921): libindicator-WARNING **: No watchers, service timing out.
If I manage to run my script in that narrow window of time then I get results! But how do I keep those services running? And what starts them in the first place? And do they include the application menu contents, or is that provided by another service?