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.


#!/bin/bash 
if (wmctrl -l | grep Terminator); 
then 
 wmctrl -a Terminator; 
else
 terminator -T Terminator; 
fi 


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.

Post a Comment