Monday 21 November 2011

Replacing the default gnome terminal

If you have ever wanted to replace the default terminal included in ubuntu with something else but were not sure if the new terminal would have the same level of integration with the gnome desktop then today is your lucky day.

The process is relatively simple but for the sake of complete integration it is slightly more involved than simply launching the desired terminal program directly. I have chosen roxterm as my replacement terminal and as such the following description will be specific to it but nevertheless can be easily modified to adapt to other terminal programs.

Here is what you will get after we are done...

1. Choosing "Open in terminal" in nautilus will launch your replacement terminal (you need to have the nautilus-open-terminal plugin installed).

2. All new terminal invocations will open a new tab in a single terminal window instead of cluttering your task-bar.

Here is what you need to do...

Modify shortcuts

Modify all shortcuts (launchers) to launch roxterm instead of gnome-terminal. Right click on the launchers in the panel and choose properties. Then change the command field to "roxterm --tab" (without the quotes)

Register roxterm with gnome as the default terminal

(Assumption: roxterm has already been installed)

1. Create a file called launch_roxterm in ~/bin (or wherever you please but then you'll have to modify the following steps)

2. Paste the following contents in it and save


import os
import sys
import re
from subprocess import *

m = re.match("cd \'([^']*)\' && exec \$SHELL", sys.argv[3])
working_dir = m.groups()[0]

shell = os.getenv('SHELL')

call(["roxterm", "--tab", "-e", shell])

3. Make the launch_roxterm file executable.

$ chmod u+x launch_roxterm

4. Run the following command in a terminal.

$ gconftool-2 --type string --set /desktop/gnome/applications/terminal/exec "$HOME/bin/launch_roxterm"

5. Install nautilus-open-terminal from synaptic if you don't have it already. Then right click on a blank area in nautilus and choose "open in terminal" from the context menu to open a new roxterm terminal or a new tab if roxterm is already running.

Note: nautilus-open-terminal, roxterm etc are available in the synaptics repository of your ubuntu distribution. I am using Ubuntu 10.10. Your mileage may vary.

No comments:

Post a Comment