Page 3 of 9 FirstFirst 12345 ... LastLast
Results 21 to 30 of 88

Thread: HOWTO: Easily open any file as root via drag & drop

  1. #21
    Join Date
    Apr 2005
    Location
    icbm://51.5221#07.4528 (E
    Beans
    21
    Distro
    Ubuntu 7.04 Feisty Fawn

    Lightbulb Re: HOWTO: Easily open any file as root via drag & drop

    23meg and Nis,

    thanks for the nice script.

    However, it didn't work for me and I modified it a little:
    Code:
    #!/bin/sh
    ### openas-root:
    ###   nautilus script for opening the selected files as superuser (uid=0),
    ###   utilizing the appropriate applications.
    
    for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
    	gnome-sudo "gnome-open $uri" &
    done
    
    ### end of file.
    Without the "for" loop, it didn't work for me. Besides that, the "&" makes the script non-blocking and opens several files at once.

    Maybe you want to add this to your first post -- other users seem to have similar problems (i.e. poyner).

    Regards,
    Alexander
    Last edited by alexp; April 12th, 2005 at 11:29 AM.

  2. #22
    Join Date
    Mar 2005
    Location
    Brisbane, Australia
    Beans
    32
    Distro
    Ubuntu 6.06

    Re: HOWTO: Easily open any file as root via drag & drop

    Quote Originally Posted by alexp
    23meg and Nis,

    thanks for the nice script.

    However, it didn't work for me and I modified it a little:
    Code:
    #!/bin/sh
    ### openas-root:
    ###   nautilus script for opening the selected files as superuser (uid=0),
    ###   utilizing the appropriate applications.
    
    for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
    	gnome-sudo "gnome-open $uri" &
    done
    
    ### end of file.
    Without the "for" loop, it didn't work for me. Besides that, the "&" makes the script non-blocking and opens several files at once.

    Maybe you want to add this to your first post -- other users seem to have similar problems (i.e. poyner).

    Regards,
    Alexander
    Alex, Thanks so much. your adjustments worked a treat! Perfect! This tip should definatley be added to the starter guide...

  3. #23
    Join Date
    Dec 2004
    Beans
    297

    Re: HOWTO: Easily open any file as root via drag & drop

    Incredibly useful.

    It doesn't just work for config files, either. Applying the script to a directory allows you effortlessly to browse as root.

  4. #24
    Join Date
    Nov 2004
    Location
    Gauteng, South Africa
    Beans
    86

    Re: HOWTO: Easily open any file as root via drag & drop

    Thanks guys, this was really usefull, hope it gets implemented into Ubuntu by default!
    we are assimilated...

    Yusuf's Blog Supplemental

  5. #25
    Join Date
    Mar 2005
    Location
    Brisbane, Australia
    Beans
    32
    Distro
    Ubuntu 6.06

    Re: HOWTO: Easily open any file as root via drag & drop

    Quote Originally Posted by jonny
    Incredibly useful.

    It doesn't just work for config files, either. Applying the script to a directory allows you effortlessly to browse as root.
    so it does...awesome!

  6. #26
    Join Date
    Apr 2005
    Location
    IRC or Forums
    Beans
    539
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: HOWTO: Easily open any file as root via drag & drop

    WOW!, that made it so much easier for me when I code

    Fantastic work 23meg!
    Best regards,
    WhatuTag - Q's & A's

  7. #27
    Join Date
    Oct 2004
    Location
    Somewhere in Virginia
    Beans
    174

    Re: HOWTO: Easily open any file as root via drag & drop

    This has definitely turned into one of the most useful things on my system since alexp's changes. And now that I know I can apply it directories (many thanks to yusufk) things are wonderful.
    Cut down on bored clutter: use the search tool.
    Have you answered a post today?
    New Ubuntu Hoary users might want to check out the Hoary After-Install Helper. Just some shameless self-promotion.

  8. #28
    Join Date
    Apr 2005
    Location
    icbm://51.5221#07.4528 (E
    Beans
    21
    Distro
    Ubuntu 7.04 Feisty Fawn

    Red face Re: HOWTO: Easily open any file as root via drag & drop

    Glad I could help . And kudos to the "gnome-open" makers; I didn't even know such an application exists on my box...

    Regards,
    Alexander

  9. #29
    Join Date
    Mar 2005
    Location
    Green
    Beans
    32

    Re: HOWTO: Easily open any file as root via drag & drop

    I'm not going to pretend to be a programmer, but would the following work for kde?


    Code:
    #!/bin/sh
    ### openas-root:
    ###   konqueror script for opening the selected files as superuser (uid=0),
    ###   utilizing the appropriate applications.
    
    for uri in $KONQUEROR_SCRIPT_SELECTED_URIS; do
    	kde-sudo "kde-open $uri" &
    done
    
    ### end of file.
    Thanks in advance

    Segrewb

  10. #30
    Join Date
    Mar 2005
    Beans
    13

    Re: HOWTO: Easily open any file as root via drag & drop

    Quote Originally Posted by Gandalf
    ok Go to Applications -> System Tools and open Terminal
    type :
    Code:
    gedit ~/.gnome2/nautilus-scripts/Open\ as\ root&
    it will open a text editor like notepad/wordpad
    paste into it
    Code:
    #!/bin/sh
    gksudo "gnome-open  $NAUTILUS_SCRIPT_SELECTED_URIS"
    click save, exit and go back to the terminal window and type:
    Code:
    chmod +x ~/.gnome2/nautilus-scripts/Open\ as\ root
    et voilà

    BTW thank you guys so much, it's so usefull and should be in the ubuntuguide TIps & Tricks, good work guys!!!

    these directions worked perfectly for me. thanks.

    is there anywhere i can get a breakdown of what that script does and how it does it?

Page 3 of 9 FirstFirst 12345 ... LastLast

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
  •