Thread: File Manager
View Single Post
Posts: 12 | Thanked: 0 times | Joined on Aug 2007 @ Seattle,WA
#20
Originally Posted by kurupted View Post
how can i make it so i can start up emelfm2 in root with out having to type it in xterm everytime.
I set up emelfm2 to run as root using these steps:
  1. Add the following line to "/etc/sudoers" (need to be root to edit it):
    Code:
    user ALL = NOPASSWD: /usr/local/lib/emelfm2/emelfm2
  2. Change the "/usr/bin/emelfm2" wrapper script file to "sudo" the actual emelfm2 executable (if not being run by root):
    Code:
    #!/bin/sh
    cd /usr/local/lib/emelfm2
    
    # Don't use 'sudo' if already root...
    UID=`id -ur 2> /dev/null`
    if [ $UID -eq 0 ]; then
      ./emelfm2 &
    else
      sudo ./emelfm2 &
    fi
    (this also puts emelfm2 into the background automatically so you'll get your shell prompt back)