Results 1 to 8 of 8

Thread: Shortcut to access sudo nautilus (gksudo nautilus) from the current window.

  1. #1
    Join Date
    May 2010
    Location
    Ireland
    Beans
    19
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Shortcut to access sudo nautilus (gksudo nautilus) from the current window.

    Hi this is my first post. Is it possible to change my current nautilus window to have sudo capabilities,? e.g. to delete locked files. It may be lazy but if it takes a lot of navigation then it would be handy to somehow activate sudo from the open window without the terminal command (gksudo nautilus) which always begins at root.

    Thanks in advance.
    Last edited by wjz; February 11th, 2011 at 06:36 PM. Reason: Manners

  2. #2
    Join Date
    Jan 2011
    Location
    Kansas City, KS
    Beans
    1,319
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Shortcut to access sudo nautilus (gksudo nautilus) from the current window.

    You can set up a Nautilus script for it, yes. I use this one by Nguyen Duc Long:

    #!/bin/bash
    #
    # this code will determine exactly the path and the type of object,
    # then it will decide use gedit or nautilus to open it by ROOT permission
    #
    #
    # Nov 19, 2010
    #Copyright by Nguyen Duc Long <Email: longnd.s8@gmail.com>
    ################################################## ##################################

    # Determine the path
    if [ -e -n $1 ]; then
    obj="$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
    else
    base="`echo $NAUTILUS_SCRIPT_CURRENT_URI | cut -d'/' -f3- | sed 's/%20/ /g'`"
    obj="$base/${1##*/}"
    fi
    # Determine the type and run as ROOT
    if [ -f "$obj" ]; then
    gksu gedit "$obj"
    elif [ -d "$obj" ]; then
    gksu nautilus "$obj"
    fi

    exit 0
    Copy this text into a new text document named "Open as Root" and set it as executable by right-clicking it and selecting the "Permissions" tab, then checking the checkbox for "Allow executing". Now, open Nautilus and right click anywhere in the content pane. In the right-click menu, select Scripts - > Open Scripts Folder. Move the text document you created here. Now, to open a folder as root, right-click it, select Scripts, then "Open as Root".

    What's cool about this script is that it works for text config files, too. They'll open in a root GEdit session.
    Last edited by Copper Bezel; February 11th, 2011 at 06:55 PM.

  3. #3
    Join Date
    Feb 2007
    Beans
    777
    Distro
    Ubuntu Development Release

    Re: Shortcut to access sudo nautilus (gksudo nautilus) from the current window.

    Install the package nautilus-gksu

    This allows you to open folders / files as root. (Wtihin normal nautilus, right click on folder/file and select 'open as administrator')
    To err is human, but not uniquely so.

  4. #4
    Join Date
    Jan 2011
    Location
    Kansas City, KS
    Beans
    1,319
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Shortcut to access sudo nautilus (gksudo nautilus) from the current window.

    My tip came with a bonus feature. = P

  5. #5
    Join Date
    May 2010
    Location
    Ireland
    Beans
    19
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Shortcut to access sudo nautilus (gksudo nautilus) from the current window.

    Hi lads, I went with Mr Bezels somewhat more work intensive approach and got it working thanks a million. Tried nautilus-gksu as well and after restarting nautilus (nautilus -q and then nautilus) it worked a treat.

    Thanks again.
    Last edited by wjz; February 11th, 2011 at 07:29 PM. Reason: manners

  6. #6
    Join Date
    Nov 2009
    Beans
    7

    Smile Re: Shortcut to access sudo nautilus (gksudo nautilus) from the current window.

    Also, you can put a link to the script on your top panel, that makes it into a drop target. To do that, just right click the panel and "Add to Panel..." then find your script and name it something. Just drop a file or folder on the panel icon from nautilus to open it in gksudo.

  7. #7
    Join Date
    Apr 2006
    Beans
    22

    Re: Shortcut to access sudo nautilus (gksudo nautilus) from the current window.

    Quote Originally Posted by ubername View Post
    Install the package nautilus-gksu

    This allows you to open folders / files as root. (Wtihin normal nautilus, right click on folder/file and select 'open as administrator')
    Add Open As Administrator to the Context Menu in Ubuntu 12.04 (Precise Pangolin)

    http://www.liberiangeek.net/2012/04/...speed=noscript


  8. #8
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,671
    Distro
    Ubuntu

    Re: Shortcut to access sudo nautilus (gksudo nautilus) from the current window.


Tags for this Thread

Bookmarks

Posting Permissions

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