summaryrefslogtreecommitdiff
path: root/zprofile
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2025-09-12 21:58:05 -0500
committerTim Keller <tjk@tjkeller.xyz>2025-09-12 21:58:05 -0500
commit8600c1fecaf71898dba0721398e26148bfbb6e78 (patch)
tree88f13d34b7c5f08a98dfb9cbcbb38c37a0bfdb0a /zprofile
parent32713b145efdd5b8d0af98b7f739cb548de4e933 (diff)
downloadzsh-8600c1fecaf71898dba0721398e26148bfbb6e78.tar.xz
zsh-8600c1fecaf71898dba0721398e26148bfbb6e78.zip
check if startx is available before running it
Diffstat (limited to 'zprofile')
-rwxr-xr-xzprofile2
1 files changed, 1 insertions, 1 deletions
diff --git a/zprofile b/zprofile
index f03ef41..39fa6b1 100755
--- a/zprofile
+++ b/zprofile
@@ -54,4 +54,4 @@ mkdir -p "$(dirname "$ZHISTFILE")"
source "$ZDOTDIR/profiles/zprofile.$HOST" 2>/dev/null # Source additional host-specific profiles
# Autostart X after login
-[ -z $DISPLAY ] && [[ $UID != 0 ]] && [[ $TTY =~ /dev/tty(1|C0) ]] && startx "$X11CONFIG/xinitrc"
+[ -z $DISPLAY ] && [[ $UID != 0 ]] && [[ $TTY =~ /dev/tty(1|C0) ]] && command -v startx &> /dev/null && startx "$X11CONFIG/xinitrc"