From 72ca23231c684b34257ddbcdebab89cd7e579e8b Mon Sep 17 00:00:00 2001 From: Gardouille Date: Wed, 19 Jun 2019 22:35:37 +0200 Subject: [PATCH] Don't ask for X session on SSH conn --- zlogin | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/zlogin b/zlogin index 14b0a6c..4e8dfe3 100644 --- a/zlogin +++ b/zlogin @@ -66,15 +66,15 @@ if [ ${USER} != "root" ] && [ $(command -v startx) ]; 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 - echo "X11 ne sera pas lancé." - else - `startx -- :1 vt1` - fi - fi + if [ -z "${SSH_TTY}" ] && [ -z "$(pidof /usr/lib/xorg/Xorg)" ] && [ ! -f ~/.noxorg ];then + echo "Aucune session X11 détectée, voulez vous en lancer une ? [O|n]" + getc start_x + if [ `echo "$start_x" | grep "n"` ];then + echo "X11 ne sera pas lancé." + else + `startx -- :1 vt1` + fi + fi fi # Keychain {{{