summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <pks@pks.rocks>2019-09-04 07:56:33 +0200
committerPatrick Simianer <pks@pks.rocks>2019-09-04 07:56:33 +0200
commit56c4affe6b7223147de447eaf21eeef0610dd7f5 (patch)
treecc39695d5eb20f2ce7b1ee1bd69ace615117ba87
parent38e1a3fec83be2cd0dee755e51bb534b09a5835d (diff)
zsh: simplify zlogin
-rw-r--r--zsh/.zlogin19
1 files changed, 12 insertions, 7 deletions
diff --git a/zsh/.zlogin b/zsh/.zlogin
index 478e144..c25f783 100644
--- a/zsh/.zlogin
+++ b/zsh/.zlogin
@@ -1,10 +1,15 @@
-if [[ $(uname) == "Linux" ]]; then
- if [ ! -n "$SSH_CLIENT" ] || [ ! -n "$SSH_TTY" ]; then
- if [[ -z $DISPLAY ]] && (( $EUID != 0 )) {
- [[ ${TTY/tty} != $TTY ]] && (( ${TTY:8:1} <= 3 )) &&
- startx 1>/tmp/xsession-errors 2>&1 &
- vlock
- }
+if [[ $(uname) == "Linux" ]]; then # on linux
+ if [ -z $SSH_CLIENT ]; then # not via ssh
+ if [[ -z $DISPLAY ]]; then # not in X
+ if [[ $TTY == "/dev/tty1" ]]; then # tty1
+ if [[ -z $(pidof X) ]]; then # no X running
+ startx 1>/tmp/xsession-errors 2>&1 & # startx
+ if [[ -x $(which vlock) ]]; then # if have vlock
+ vlock # run it
+ fi
+ fi
+ fi
+ fi
fi
fi