Created
May 15, 2016 16:17
-
-
Save nihilismus/1d8df0b8f7432143e8618a6ecdf66c36 to your computer and use it in GitHub Desktop.
Execute startx automatically in a linux system (/dev/tty1 or Ctrl+Alt+F1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# sdm.sh : Start X **automagically** when login-in /dev/tty1 | |
# | |
# Add the execution of this script, or the next lines, at the | |
# end of ~/.bashrc or ~/.bash_profile | |
TTY="$(/usr/bin/tty | sed 's:.*/::')" | |
if [[ ! ${DISPLAY} && ${TERM} == 'linux' && ${TTY} == 'tty1' ]]; then | |
unset TTY | |
exec startx | |
fi | |
unset TTY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment