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.

2 Answers 2


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();'

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?

  • 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, 2011 at 19:43
  • If there's no lg command, then what does Alt-F2 execute?
    – ams
    Dec 30, 2011 at 19:57
  • 1
    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, 2011 at 23:02
  • Ah sorry, I didn't know that. I thought ALT+F2 just executes commands.
    – lumbric
    Dec 31, 2011 at 17:18
  • You can run lg from a plain terminal if you turn it on: see askubuntu.com/a/118642/6161. Apr 3, 2012 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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