.

Labels

.

Opening as root by right-clicking

Script for ' opening as root ' by right-clicking.Place this script inside .gnome2/nautilus-scripts/

(Go to home folder and press "Ctrl h" to see .gnome2 folder; inside this folder nautilus-scripts folder is present; place this script there; script can have any name but naming it 'open as root' make some sense; make script executable)

Make sure that gnome-open is installed else install it by sudo apt-get install libgnome2-0 ( Ubuntu ) in terminal or through Software Centre ( Ubuntu ) or Add/Remove Software ( Fedora ).



HOW THIS SCRIPT WORKS:
Nothing much to explain.
'gksu' is the GTK+ frontend for su and sudo
'$*' represent the complete path of the file you have selected i.e script.txt file in Desktop will have a complete path name  /home/$USER/Desktop/script.txt
'gnome-open' will open files and URLs using the default program.

#!/bin/bash

#to open as root

gksu gnome-open "$*"

[Download script]





This script will save a lot of your time !!

Enjoy Linux !!




No comments:

Post a Comment