Fandom

How To Wiki

How to autostart X Windows without a graphical login manager

1,795pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

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

Also on Fandom

Random Wiki