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.

On Ubuntu 11.10, using GNOME Shell, I find myself using the "Looking Glass" JavaScript Console very much. I know how to assign desktop shortcuts in general; but, this seems a little unusual.

Instead of typing Alt+F2lgEnter, I'd like to assign a shortcut key to perform this. However, shortcuts normally require a command file and there's the rub. I am unaware of a command file for the looking glass tool.

How can I set a keyboard shortcut to perform the Alt+F2lgEnter keystrokes?

Clarification: Instead of pressing a 4-key sequence, I want to use a 1-key shortcut to invoke lg.

share|improve this question
add comment

2 Answers

You can use this GNOME extension to assign a keyboard shortcut to activate looking-glass.

By default, it uses Super+ X to activate looking-glass but you can configure that keyboard shortcut.


Alternatively, you can use the command to activate looking-glass and bind it to a specific keyboard shortcut.

gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval 'Main.lookingGlass.toggle();'
share|improve this answer
add comment

This answer probably doesn't solve the problem. See comments for details.

You can run any command by setting a custom command. To be precise you won't set a keyboard shortcut to perform Alt+F2lgEnter, but to run the command lg.

This question explains how to do so: How to bind custom commands to keyboard shortcuts?

share|improve this answer
    
I don't see how this answers my question. Technically, there is no lg command. If there were, it'd be a cinch using the technique described. –  TheGeeko61 Dec 30 '11 at 19:43
    
If there's no lg command, then what does Alt-F2 execute? –  ams Dec 30 '11 at 19:57
    
lg is internal to Alt-F2. When I say that it is not a command, I am referring to the fact that one cannot go to a plain terminal (i.e., console) and type lg. There is no command file which executes in response to that entry on the command line. –  TheGeeko61 Dec 30 '11 at 23:02
    
Ah sorry, I didn't know that. I thought ALT+F2 just executes commands. –  lumbric Dec 31 '11 at 17:18
    
You can run lg from a plain terminal if you turn it on: see askubuntu.com/a/118642/6161. –  David Oneill Apr 3 '12 at 19:43
add comment

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.