Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # First, please make sure gksudo is installed
- # Run 'sudo apt-get install gksu' to make it sure
- # Get the path
- if [ -e -n $1 ]; then
- obj="$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
- else
- path="`echo $NAUTILUS_SCRIPT_CURRENT_URI | cut -d'/' -f3- | sed 's/%20/ /g'`"
- selected="$path/${1##*/}"
- fi
- #Check if selected object file or folder
- if [ -f "$selected" ]; then
- gksudo gedit "$selected"
- elif [ -d "$selected" ]; then
- gksudo nautilus "$selected"
- fi
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement