How To Wiki
Advertisement

This Howto shows you howto setup you computer to automatically start X Windows when you use non-graphical login.

Requirements[]

Cost Time Difficulty Age Group
0 15m med NA
About:Ratings

Steps[]

  1. Login as user that you wish to have X autostart
  2. if you use bash; edit ~/.bash_profile; or you shells rc file
  3. Add the following to the end of the file
case `tty` in
  /dev/tty[1])
      echo -n "Start X [Yn]? "
      expect \
          -c 'stty raw' \
          -c 'set timeout 5' \
          -c 'expect -nocase n {exit 1} -re . {exit 0}'
      if [ $? = 0 ] ; then
          startx
          echo -n "Log out [Yn]? "
          expect \
              -c 'stty raw' \
              -c 'set timeout 5' \
              -c 'expect -nocase n {exit 1} -re . {exit 0}'
          if [ $? = 0 ] ; then
              logout
          fi
      fi
      echo
  ;;
esac
This code shouldn't load X unless X is not open and you are just logging in
  • Be sure to have a .Xdefault in you home directory to start you windows manager See: Guide to configuring X windows


    From HowTo Wiki, a Wikia wiki.
Advertisement