Nautilus Scripts

Suggestions and feedback for Linux Mint and the forums
Forum rules
Do not post support questions here. Before you post read: Where to post ideas & feature requests
Post Reply
Crashmaxx
Level 1
Level 1
Posts: 14
Joined: Thu Nov 16, 2006 12:26 am

Nautilus Scripts

Post by Crashmaxx »

Automatix installs some nautilus scripts so in the right-click context menu you can open the folder as root and open a file in gedit as root. I think these are awesome, as you don't have to go into terminal to change permissions or move system files or edit a config file.

It would be nice to have these scripts included with install. It would really help noobs or anyone who likes to use GUI to do things.
User avatar
clem
Level 12
Level 12
Posts: 4303
Joined: Wed Nov 15, 2006 8:34 am
Contact:

Post by clem »

This is a great idea. I also saw in SUSE 10.2 that the terminal was present in the context menu. Do you have more info about these scripts?
Crashmaxx
Level 1
Level 1
Posts: 14
Joined: Thu Nov 16, 2006 12:26 am

Post by Crashmaxx »

I found this page that tells you most of what you could want to know about it:
http://g-scripts.sourceforge.net/index.php

But the idea is, any script you put in ~/.gnome2/nautilus-scripts, will show up in the right click menu under scripts.

I have a copy of the three main scripts I use, which are gedit-root, root-nautilus-here, and search-here. I can send you them if you'd like, or you can use automatix2, which will install them. I recommend looking around the link I gave, other scripts might be worthwhile too.

Anyway, show be a piece of cake to include and seems to be something built into gnome and nautilus. Gotta love linux, windows would never have something this slick. You'd have to run something in the task bar, or screw with the registry to get something like this for windows.
User avatar
clem
Level 12
Level 12
Posts: 4303
Joined: Wed Nov 15, 2006 8:34 am
Contact:

Post by clem »

Is there an "all users" equivalent of ~/.gnome2/nautilus-scripts ? Some sort of /etc/nautilus-scripts or something ?

Clem
User avatar
clem
Level 12
Level 12
Posts: 4303
Joined: Wed Nov 15, 2006 8:34 am
Contact:

Post by clem »

Ok,

I had a look at that and I have some good news: nautilus-open-terminal will be included in Bea. This will allow to open a terminal from any folder from nautilus.. through the context menu.

I test nautilus-gksu which allows to open a folder as root but I found it buggy. It doesn't work with metaaddresses.. (computer and home for instance), and for some reason it opens two windows instead of one. Also it is hard to see which windows are open as root, and which aren't. So I decided not to include that.

Clem
Crashmaxx
Level 1
Level 1
Posts: 14
Joined: Thu Nov 16, 2006 12:26 am

Post by Crashmaxx »

Very cool. Thanks.

Here are the three automatix gave me, that work fine for me. Just create a file with the name given and paste in the code, and obviously, make them executable and move them into the nautilus-scripts folder.

gedit-root

Code: Select all

#!/bin/bash
#created by arnieboy 
foo=`gksudo -u root -k -m "enter your password for gedit root access" /bin/echo "Do you have root access?"`
sudo gedit $NAUTILUS_SCRIPT_SELECTED_URIS
root-nautilus-here

Code: Select all

#!/bin/bash

# Opens a nautilus window as root.

foo=`gksudo -u root -k -m "enter your password for nautilus root access" /bin/echo "got r00t?"`
sudo nautilus --no-desktop $NAUTILUS_SCRIPT_CURRENT_URI
search-here

Code: Select all

#!/bin/bash
cd $NAUTILUS_SCRIPT_CURRENT_URI
exec gnome-search-tool
Clearly, these are pretty easy to make. I'm very happy that I looked into this, cause I learned a lot about this feature. Now I can make my own scripts if I like.

If anyone else has a favorite script, I'd like to see it. Or if you know how to do bash scripting, now hopefully you know how to make a nautilus script.
Post Reply

Return to “Suggestions & Feedback”