Nautilus scripts (1 Viewer)

Buickman

Super Forum Fanatic
Diamond VIP Contributor
Joined
Sep 30, 2004
Messages
8,757
Reaction score
11,956
Age
59
Location
Chester Gap, Va
Offline
Anyone know of any scripts that will let me run nautilus as root when I'm logged in as a user? Automatix had some scripts, however they've closed up shop and aren't making a version for Hardy. What this did was add some right-click options in nautilus with one being "root nautilus here."

TIA
 
I just installed it with apt-get, but how do you use it?

I did do a restart.
 
Think I figured it out. Just run "sudo nautilus" in the terminal, right?
 
Well that will definitely work, but the nautilus-gksu package is supposed to add an "Open as Administrator" [or something to that effect] option when right-clicking inside Nautilus. I installed the package and restarted X, but I still don't see the option.

I did find this page that explains how to make your own:


Ubuntu: Easy (And Quick) Ways To Open Any Files As Root - Make Tech Easier

Ok, I just followed this and it seemed to work (actually tried all 3, and step 3 tried to work).




3) Use nautilus-script

If for some reason, you can’t install the ‘nautilus-gksu‘, you can achieve the same function via creating a nautilus script manually.

In the terminal,

gedit $HOME/.gnome2/nautilus-scripts/Open\ as\ Administrator

Insert the following lines into the new file:

for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do gksudo “gnome-open $uri” & done

Save the file.

Make the file executable:

chmod +x $HOME/.gnome2/nautilus-scripts/Open\ as\ Administrator

You can now open files as root by right clicking on the file and selecting Scripts->Open as Administrator

The menu option shows up, but when I right-click on something (/etc/fstab for instance) and select "open as administrator" nothing happens.


That script would work, but how do I make that a menu option rather than run it from the terminal every time?
 
Nevermind. I figured it out by combining both.

llamakc's script created /home/tim/.gnome2/nautilus-scripts/open as administrator.

I opened that, and added the script from eaux-yeah's link to that file;
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

That did the job. Now I just right-click -> scripts ->open as administrator

and it works.

Thanks guys. And FYI, this was for Hardy, so it works with the new version of nautilus.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Users who are viewing this thread

    Back
    Top Bottom