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();'
The wmctrl package offers access and manipulation of application windows and would do what you want. Install this little package first:
sudo apt-get install wmctrl
Here is the man page for wmctrl:
http://manpages.ubuntu.com/manpages/precise/en/man1/wmctrl.1.html
When you look at the command line switches, you will see that -a will raise and focus a window. In order to know which window to focus, make sure you have a Chromium window open, and then run
wmctrl -l
This will give you a list of all open windows and their titles. Chromium will most likely always have "Chromium" in the end of it's window title, so you can use that.
With this information at hand, you can construct your command for the shortcut. Open the Keyboard preferences, go to Shortcuts, click on Custom Shortcuts, click the + sign and enter:
Name: Focus Chromium Shortcut
Command: wmctrl -a 'Chromium'
I am using Unity and just tried this with Google Chrome, it did the trick. It should work in Gnome-Shell as well.
Pretty cool idea :)
DrTebi
Best Answer
I found the answer -
autokey
. This lets you set up shortcuts that can be triggered either by a hot key, or simply typing an abbreviation. I've already added automatic replacement for the common mispellings I make, like replacing "hte" with "the".You can install autokey with with synaptic package manager, for either KDE or GNOME. For Ubuntu 14.04 and newer, the package is
autokey-gtk
.I'm a long time Ubuntu user, and I'm kicking myself for missing out on this awesome little app until now.