Wikia

How To Wiki

How to autostart X Windows without a graphical login manager

1,794pages on
this wiki
Talk0

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

RequirementsEdit

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

StepsEdit

  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

Around Wikia's network

Random Wiki