Advertisement
hok00age

Open as Administrator Ubuntu 13.04

Jun 11th, 2013
692
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.48 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # First, please make sure gksudo is installed
  4. # Run 'sudo apt-get install gksu' to make it sure
  5.  
  6. # Get the path
  7. if [ -e -n $1 ]; then
  8.     obj="$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
  9. else
  10.     path="`echo $NAUTILUS_SCRIPT_CURRENT_URI | cut -d'/' -f3- | sed 's/%20/ /g'`"
  11.     selected="$path/${1##*/}"
  12. fi
  13.  
  14. #Check if selected object file or folder
  15. if [ -f "$selected" ]; then
  16.     gksudo gedit "$selected"
  17. elif [ -d "$selected" ]; then
  18.     gksudo nautilus "$selected"
  19. fi
  20.  
  21. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement