main/zsh: .zprofile isn't sourced by login shell
Previously, I was using bash as my default shell and had no problems with sourcing .bash_profile
under $HOME directory. Now that I switched to zsh, logging in results in login shell prompt, thus I have to manually source .zprofile
. Contents of .zprofile
with skipped shell variables:
#!/bin/zsh
export PATH="$PATH:$(du "$HOME/.local/bin" | cut -f2 | tr '\n' ':' | sed 's/:*$//')"
unsetopt PROMPT_SP
# Variables
[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC"
zsh version: 5.8.1