Nautilus Script to Launch a Terminal
I often find myself browsing my filesystem with Nautilus (the GNOME file manager) and wanting a terminal window to manipulate files in the current directory. I decided to take a shot at writing my own Nautilus script to solve the problem. So here's my first Nautilus script. Save it in $HOME/.gnome2/nautilus-scripts. I named it terminal-here on my system.
#!/bin/bash
#
# Nautilus script - terminal-here
# This script will open a GNOME Terminal in the current directory.
# Written by Linerd in August, 2009 - http://tuxtweaks.com/
#
# Save this script under $HOME/.gnome2/nautilus-scripts/terminal-here. Make sure that
# you give this file executable permission. { chmod +x terminal-here }
#
# This program is free software. It is distributed in the hope
# that it will be useful, but WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
######################################################################
if [ "$NAUTILUS_SCRIPT_CURRENT_URI" == "x-nautilus-desktop:///" ]; then
DIR=$HOME"/Desktop"
else
DIR=`echo $NAUTILUS_SCRIPT_CURRENT_URI | sed 's/^file:\/\///' | sed 's/%20/ /g'`
fi
gnome-terminal --working-directory="$DIR"
exit 0
Make sure to make the file executable.
You can now launch a terminal by right clicking in Nautilus and selecting Scripts?terminal-here.
Being quite pleased with myself for my accomplishment, I then searched the web for similar solutions. Not only had others written scripts to do this, but some even chose the same name. The winner for being brief and simple was one I found on SourceForge, also called terminal-here.
I also found that there is also a plugin available for Nautilus that does the same thing. You can install it with
You will need to log out and log back in for the plugin to show up in the contect menu. It's nice that it's right there on the menu when you right click rather than being buried in a sub-menu under the Scripts menu.
I ended up finding a couple of better solutions than my own hack, but it was a good learning process.
Edit Your GNOME Configuration
There are hundreds of settings you can configure in the GNOME Desktop Environment. For example, Nautilus is the default file manager in GNOME. Beside it's obvious use as a file manager, Nautilus also controls user interaction with desktop icons. Many of Nautilus' settings can be controlled through the Preferences menu. You can access this by opening a file manager and selecting Edit?Preferences.
There are many useful features that can be controlled through the aforementioned menu, however, there are some useful preferences that can't be accessed through the Nautilus menu. That's where the GNOME Configuration Editor comes in.
Install the GNOME Configuration Editor
If you're using Ubuntu, then this useful program is not installed by default. There are several ways to install it, but I'll use the terminal since it's easiest to document.
You can now start the GNOME Configuration Editor through the menu with Applications?System Tools?Configuration Editor.
Change the Desktop Icons
One of the things you can change is which desktop icons will show up. Within the Configuration Editor navigate to /apps/nautilus/desktop. From this section you can choose to show the Computer Icon, your Home Icon, etc.
What Else Can You Change?
The GNOME Configuration Editor is a powerful tool. Take a look around and see what else you can tweak.


