I’ve never been a fan of wasting time, and definitely with any kind of work – I’ll always aim to be able to get it done in the least amount of time possible (as I’m sure most other people would). Recently I have been delving into the “world” of keyboard shortcuts (far past the ever-so-useful ‘alt-tab’, ‘ctrl-c’, ‘alt-f4′ group of shortcuts). Using my Ubuntu linux system I have been able to configure all the applications I use with keyboard shortcuts – I barely even have to reach for the mouse. Granted “never having to move my hand to my mouse” sounds excessively lazy, but laziness isn’t always a bad thing. As it turns out moving my hand to use my mouse and back repetitively wastes a lot of time – and if I could create a keyboard shortcut to do the same thing in much less time then why not?
Global Shortcuts
I use the “compizconfig-settings-manager” to set up my keyboard shortcuts for my entire desktop, along with a program called “wmctrl” for some extra command-line based control. These can both be installed with “sudo apt-get install compizconfig-settings-manager wmctrl”. There is also an amazingly useful Firefox plugin called “MozRepl”. MozRepl allows you to send JavaScript commands to your browser from the command line which I also use.
Heres a list of the shortcuts I use. The <Super> key is the key with the Windows logo on most keyboards, while <Menu> is available on the right of some keyboards such as mine (between Alt and Ctrl)
<Super>-T: Starts up a gnome-terminal (I use it so often it got its own keyboard shortcut). Set in the “Commands” section of CompizConfig. the command is just: gnome-terminal
<Super>-R: Similar to the above command but for my music player – Rythmbox. This shortcut also uses wmctrl to bring rythmbox into focus if its already running. Set in the “Commands” section of CompizConfig. the command is just: rhythmbox && wmctrl -xa “Rhythmbox”
<Menu>: I have set this key to launch my keyboard-shortcut based editor ‘gvim’ (gnome version of Vi IMproved). gvim has enough keyboard shortcuts (and many many more) to deserve its own post and probably more. This shortcut opens my TODO file automatically and also brings gvim into focus if it is already running. CompizConfig command: wmctrl -xa “GVIM” || gvim ~/TODO
<Super>-1: This shortcut uses wmctrl to resize a window to its maximum size on a 1024×768 monitor. You’ll need to use the mouse to select the window you want (or you could switch the SELECT word with ACTIVE to use the active window). I use this quite a lot for testing how sites look (along with the similar <Super>-8 shortcut). The CompizConfig command is: wmctrl -r :SELECT: -e 0,0,0,1024,728
<Super>-8: Same as the above, for 800×600 screens. Command: wmctrl -r :SELECT: -e 0,0,0,800,560
<Super>-<up>: Shortcut to set a window to be above all others (much quicker than clicking the small icon in the top left and choosing always on top). CompizConfig command: wmctrl -r :ACTIVE: -b add,above
<Super>-<down>: Same as the above, removes the “always on top” property: wmctrl -r :ACTIVE: -b remove,above
<Super>-<right>, <Super>-<left>: I chose to use these instead of Alt-Tab and Alt-Shift-Tab respectively . This was mainly to have an easier command than Alt-Shift-Tab which I find quite awkward. I use the Static Application Switcher compiz plugin for the commands while having Alt-Tab still enabled on other more fancy switchers for other people using my computer.
<Super>-Y: One of my newer shortcuts – but quickly becoming one of my favorites. This one uses the MozRepl firefox plugin (make sure its set to auto-start on port 4242) to refresh the currently active window. This means I can check what my changes have done without having to switch from my editor window. Unfortunately for pages with POST data, Firefox still comes up with a confirmation dialog that needs to be clicked – if anyone has any suggestions to avoid that please let me know. The CompizConfig Commands command I use is: echo content.location.reload\(\)\; | nc -q 1 localhost 4242
<Super>-R: Easily the best timesaving command – it sets up a window resize without having to try get your mouse exactly on the border. Hit <Super>-R and then move your mouse right to make the window wider to the right – or a quick right and then left to make it less wide. You can set this through the CompizConfig Resize Window plugin – make sure Resize Info is enabled.
<Ctrl>-<Alt>-<Backspace>: This is a standard linux window manager command which restarts the window manager. It acts as a reboot for only the window manager, so is almost instant – but often solves any problem (or if the window manager crashes). This was disabled in the latest Ubuntu version, but can be turned back on by adding, Option “DontZap” “false”, in the “ServerFlags” section of /etc/X11/xorg.conf
Those are my most commonly used non-default global configuration settings, I’ll write up a post on my new favorite keyboard shortcut based editor GVIM sometime soon – but for now, if anyone has any global shortcuts they recommend (or have any idea how to fix the Firefox confirm post problem I have with <Super>-Y) let me know in the comments.



