Results 1 to 2 of 2

Thread: nautilus-gksu

  1. #1

    Default nautilus-gksu

    I'd really like a tool to open something as root from Nautilus. It's irritating to want to edit a file and then have to open a terminal, rather than just directly right click and open as root.

    According to Linux Tip: Do more with Nautilus , Ubuntu has such a package.

    There are also steps here: :: View topic - Open As Root? for adding a script to do the same thing, but we don't have gksudo (just sudo).

    I'd really like to see this happen in openSUSE...

  2. #2

    Default Re: nautilus-gksu

    Here is a work-around. First create a new, empty nautilus script:

    Code:
    mkdir -p ~/.gnome2/nautilus-scripts
    touch "~/.gnome2/nautilus-scripts/Open As Root"
    Then place the following code inside of it:

    Code:
    #!/bin/sh
    
    if [[ -z "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]]
    then
    	NAUTILUS_SCRIPT_SELECTED_FILE_PATHS=${NAUTILUS_SCRIPT_CURRENT_URI/file:\/\//}
    fi
    
    for path in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
    do
    	if [[ -d "$path" ]]
    	then
    		gnomesu -- nautilus --no-desktop "$path"
    	else
    		gnomesu -- gnome-open "file://$path"
    	fi
    # uncomment the next line to process only the first path
    	#break
    done
    Now make it executable:

    Code:
    chmod a+x "~/.gnome2/nautilus-scripts/Open As Root"
    Restart nautilus and you should now see a "Scripts" submenu below "Open With", and under the Scripts submenu should be "Open As Root", which will open folders in a new nautilus window as root, and files in their default applictions as root.

    HTH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •