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
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...
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.
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!
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!
Re: HOWTO: Easily open any file as root via drag & drop
WOW!, that made it so much easier for me when I code \\:D/
Fantastic work 23meg!
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. :)
Re: HOWTO: Easily open any file as root via drag & drop
Glad I could help :razz:. And kudos to the "gnome-open" makers; I didn't even know such an application exists on my box...
Regards,
Alexander
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
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ą :D
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?