we often need to edit files as root in a text editor. Now we can do this with a right click in Nautilus (no big deal about opening in terminal but what the heck!)
Code:
gedit ~/.gnome2/nautilus-scripts/gedit-root
Copy the following lines into the file and save it and close it.
Edited
Code:
#created by Arnav Ghosh (United States)
foo=`gksudo -u root -k -m "enter your password for gedit root access" /bin/echo "Do you have root access?"`
sudo gedit $NAUTILUS_SCRIPT_SELECTED_URIS
Then make it executable with
Code:
chmod +x ~/.gnome2/nautilus-scripts/gedit-root
thats it you are all set. Now right click on any file in nautilus and under "scripts" u will find "gedit-root"
click and enjoy!
U can even select multiple files and open them in gedit as root in tabbed windows just by right clicking and using this script. The possibilities are endless.