5

Alt is used to open the HUD in 12.04.

I'd like to use alt to execute a second action as well as open the HUD by having alt execute an executable script.

So Alt = script, that does HUD and other stuff.

I know how to do all of this except call the HUD from the command line.

8

The HUD service is available as a service on DBus, so if you'd just like to poll it for information you can do that with a gdbus command, like this.

gdbus call --session --dest com.canonical.hud --object-path /com/canonical/hud --method com.canonical.hud.StartQuery "my query" 5

If you're trying to get Unity to show the HUD prompt you can do that with the XTest extension using xdotool like this:

xdotool key alt

If you're interested in playing with HUD it's probably best to use the hud-gtk tool which is in the indicator-appmenu-tools package.

  • What does the 5 at the end of your code do? – Reinstate Monica - ζ-- May 16 '12 at 11:50
  • The 5 adjusts the number of entries that are returned. So if you had some way to display more entries, you could pass a larger number. – Ted Gould May 20 '12 at 17:58
  • 2
    I copied the command into the terminal and I got the following output: ('', @a(sssssv) [], <'query key'>) Am I missing part of the command, or does part of the command need to be modified in order to work correctly? – Anderson Green Nov 13 '12 at 17:50
  • change the "my query" bit to something that might be in your current hud - perhaps "file" – Alan Bell Jan 4 '13 at 23:10
  • 1
    Is there official documentation for the HUD DBUS interface? Searching doesn't seem to turn up much. – detly Jan 7 '13 at 5:49
4

You can query the hud from the command line using hud-cli, but it doesn't actually raise the Unity side of hud and it doesn't let you activate the results. It's really only useful for testing hud searches.

I don't think there is a way to do what you are describing at this time.

  • You're my hero. And I might be a noob at Python, but my limited abilities have solved many of these little challenges in the past. I'll try to re-write my own HUD GUI. – Isaac May 15 '12 at 20:14
  • This is sooo cool!!! Can I do the same with the dashboard search!?!??!? – Isaac May 15 '12 at 20:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.