summaryrefslogtreecommitdiff
path: root/zsh/.zlogin
blob: 8970617f959c90be979bfad22dfde9e46dbe765f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 -- vt1 1>/var/log/Xsession.log 2>&1 & # startx (on tty1)
          if [[ -x $(which vlock) ]]; then             # if have vlock ...
            vlock                                      # ... run it
          fi
        fi
      fi
    fi
  fi
fi