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.

BuZZ-dEE
  • 14,223
Isaac
  • 683

2 Answers2

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.

Jorge Castro
  • 71,754
Ted Gould
  • 3,425
  • What does the 5 at the end of your code do? – nanofarad 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 04 '13 at 23:10
  • 1
    Is there official documentation for the HUD DBUS interface? Searching doesn't seem to turn up much. – detly Jan 07 '13 at 05:49
  • I'm also looking for the documentation as requested in the above comment. Executing a search works, but it's not clear where to go from there. I see an ExecuteQuery function on the D-Bus interface, but the arguments are not clear to me... – jeroen Jan 16 '13 at 20:31
  • In HUD 2.0 we added a library libhud-client that provides a way to access the HUD service with an API. It's not currently in raring, but should show up in S. I wouldn't recommend using the DBus interface, but instead using the library. – Ted Gould Apr 23 '13 at 19: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.

Ken VanDine
  • 1,195
  • 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