Nautilus Scripts - Terminal, File Finder
Written by BinnyVA on April 9, 2007 – 2:24 am -
I prefer using KDE and its excellent file manager Konqueror. But before I began using that, I was using Gnome’s Nautilus. To fill in the gaps that were missing in Nautilus, I created a few Nautilus Scripts for various things like opening up terminals, opening a file finding application etc.
Some of the scripts I used are given below. To install these script, just create a file with this data, give it the permission 755 and put it in the folder ‘~/.gnome2/nautilus-scripts/’. Nautilus looks in this folder for all its executable scripts.
Backuper (By Me)
# Backuper V 1.00.A
# By Binny V A (http://lindesk.com/)
# Creates a Backup of the selected file and appends a timestamp to it
# in the format '<Filename.ext>_Feb06_20.45.58.bak'
echo -n "cp '$1' '$1_">/tmp/backuper.sh
date "+%b%d_%H.%M.%S.bak'">>/tmp/backuper.sh
sh /tmp/backuper.sh
Open Terminal
#!/usr/bin/perl -w
# Open terminal here
#
# Nautilus script that opens a gnome-terminal at the current location, if it's
# a valid one. This could be done in shell script, but I love Perl!.
#
# 20020930 -- Javier Donaire <jyuyu@fraguel.org>
# http://www.fraguel.org/~jyuyu/
# Licensed under the GPL v2+
#
# Modified by: Dexter Ang [thepoch@mydestiny.net]
# 2003-12-08: Modified for Gnome 2.4
# - Added checking if executed on Desktop “x-nautilus-desktop:///”
# so that it opens in /home/{user}/Desktop
#use strict;
$_ = $ENV{’NAUTILUS_SCRIPT_CURRENT_URI’};
if ($_ and m#^file:///#) {
s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
s#^file://##;
exec “gnome-terminal –working-directory=’$_’”;
}
# Added 2003-12-08 Dexter Ang
if ($_ == “x-nautilus-desktop:///”) {
$_ = $ENV{’HOME’};
$_ = $_.’/Desktop’;
exec “gnome-terminal –working-directory=’$_’”;
}
To get this functionality in Konqueror, just open up the folder you want in Konqueror and choose Tools->Open Terminal(or press F4)
Search Here
#!/usr/bin/perl
# Nautilus script that opens the gnome-search-tool(Actions->Search for Files) tool in the
# selected directory.
#
# Author : Binny V A
# http://lindesk.com/
# Copied from 'Open Terminal Here' Script
$_ = $ENV{'NAUTILUS_SCRIPT_CURRENT_URI'};
if ($_ and m#^file:///#) {
s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
s#^file://##;
exec “gnome-search-tool –path=’$_’ –contains=”;
}
if ($_ == “x-nautilus-desktop:///”) {
$_ = $ENV{’HOME’};
$_ = $_.’/Desktop’;
exec “gnome-search-tool –path=’$_’ –contains=”;
}
Konqueror makes this much easier. Just choose Tools->Find Files
If you are intrested in finding more scripts like this, visit http://g-scripts.sourceforge.net/
del.icio.us | Digg it | Furl | ma.gnolia | reddit | StumbleUpon |
Posted in Applications, Gnome |

January 31st, 2008 at 8:10 pm
I searched all over until i found you sharing this useful script. Thanks a million.