Are you a spammer

Please note, that the first 3 posts you make, will need to be approved by a forum Administrator or Moderator before they are publicly viewable.
Each application to join this forum is checked at the Stop Forum Spam website. If the email or IP address appears there when checked, you will not be allowed to join this forum.
If you get past this check and post spam on this forum, your posts will be immediately deleted and your account inactivated.You will then be banned and your IP will be submitted to your ISP, notifying them of your spamming. So your spam links will only be seen for an hour or two at most. In other words, don't waste your time and ours.

This forum is for the use and enjoyment of the members and visitors looking to learn about and share information regarding the topics listed. It is not a free-for-all advertising venue. Your time would be better spent pursuing legitimate avenues of promoting your websites.

Adding scripts in nautilus

Post your How to's here


Adding scripts in nautilus

Postby bagheera1994 » Sat Nov 24, 2007 3:34 pm

Few scripts (grabbed from the net) in nautilus can make your live easier:
OS: Ultimate 1.6

Place to put scripts in: ~/.gnome2/nautilus-scripts/ and in nautilus (right mouse key)
to use these scripts.

1] mount iso and open volume: (copy and paste and make executable)
_______________________-start script - ____________________________________
#!/bin/bash
# mount

gksudo -k /bin/echo "got r00t?"

BASENAME=`basename $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS .iso`

sudo mkdir "/media/$BASENAME"

zenity --info --title "ISO Mounter" --text "$BASENAME $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"

if sudo mount -o loop -t iso9660 $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS "/media/$BASENAME"
then
if zenity --question --title "ISO Mounter" --text "$BASENAME Successfully Mounted. Open Volume?"

then
nautilus /media/"$BASENAME" --no-desktop
fi

exit 0
else
sudo rmdir "/media/$BASENAME"

zenity --error --title "ISO Mounter" --text "Cannot mount $BASENAME!"

exit 1
fi

______________________- end script - _____________________________________

2] umount iso (copy and paste and make executable)
_______________________-start script - ____________________________________
#!/bin/bash
# unmount

gksudo -k /bin/echo "got r00t?"

BASENAME=`basename $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS .iso`

sudo umount "/media/$BASENAME"

sudo rmdir "/media/$BASENAME"

zenity --info --text "Successfully unmounted /media/$BASENAME"

exit 0
______________________- end script - _____________________________________

3] open a console in current nautilus location (copy and paste and make executable)
_______________________-start script - ____________________________________
#!/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 <[email protected]>
# http://www.fraguel.org/~jyuyu/
# Licensed under the GPL v2+
#
# Modified by: Dexter Ang [[email protected]]
# 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='$_'";
}
______________________- end script - _____________________________________

You may reply with more tested scripts for in use with nautilus....
Greetz bagheera1994
Born in august 1973.
http://en.wikipedia.org/wiki/August_23
Freedom is not worth having if it does not include the freedom to make mistakes.{Mahatma Gandhi}
bagheera1994
U.E. Knowledgable
U.E. Knowledgable
 
Posts: 38
Joined: Sun Nov 18, 2007 6:01 am
Location: Netherlands
Age: 112
Operating System: Ultimate Edition 2.3 32 BIT

Return to How To's (Do not post questions please)

Who is online

Users browsing this forum: No registered users and 4 guests