Thursday, October 21, 2010

Terminator at my Fingertips

I am big on keyboard shortcuts. For a couple of years now I've set Ctrl-Shift-o to start gnome-terminal. This works great. A little too great. I end up with a dozen gnome-terminal windows scattered across 4 workspaces. I decided to stop the madness. I installed Terminator and wrote the small bash script below. The script below will search for a Terminator session and if found bring it in to focus. If Terminator is not running it will start it.

if (wmctrl -l | grep Terminator); 
 wmctrl -a Terminator; 
 terminator -T Terminator; 

If you are using Ubuntu like me you can use the following command to install Terminator and wmctrl.

sudo apt-get install terminator wmctrl

If you want to try this copy and paste the script to a file and make the file executable. Then use gconf-editor to set your keyboard shortcut to your script.

No comments: