Small feature update for login session: possibility to disable X

session.
This commit is contained in:
gardouille 2014-09-27 10:30:42 +02:00
parent b04d4b6d50
commit 74d8b4c8e7
1 changed files with 8 additions and 5 deletions

13
zlogin
View File

@ -19,7 +19,6 @@ bonjour
# Afficher la liste todo (paquet devtodo)
echo "\n\nListe de tâches:"
#todo -G --global-database /home/$USER/.todo
todo -G --global-database ~/.todo
# Accepte les messages d'autres utilisateurs
@ -49,11 +48,14 @@ getc ()
}
# Si on est dans une console vc, et qu'aucune
# instance de X n'est détecté, demander si
# startx doit être lancé
## Autorun an X session with some restrictions
## Set a ~/.noxorg file to work in tty only
# If non-root session
if [ ${USER} != "root" ]; then
if [ -n `tty | grep '/dev/tty'` ] && [ -z "`ps aux|grep "start[x]"`" ];then
# If it's a VC console and
# no X session already launch and
# no ~/.noxorg file exist
if [ -n `tty | grep '/dev/tty'` ] && [ -z "`ps aux|grep "start[x]"`" ] && [ ! -f ~/.noxorg ];then
echo "Aucune session X11 détecté, voulez vous en lancer une ? [O|n]"
getc start_x
if [ `echo "$start_x" | grep "n"` ];then
@ -77,5 +79,6 @@ fi
# Launch Keychain for GPG
#[ -f $HOME/.keychain/$HOST-sh-gpg ] && \
#keychain --agents gpg
#. $HOME/.keychain/$HOST-sh-gpg