Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 8 down vote accepted

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.

share|improve this answer
    
What does the 5 at the end of your code do? –  hexafraction 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
    
Thanks for the information! –  hexafraction May 20 '12 at 21:07
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
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

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.

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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