zsh: Use $+commands[] instead of command -v

This commit is contained in:
2022-03-31 00:46:46 +02:00
parent 8008cb1a63
commit 0ba0c04c56
6 changed files with 15 additions and 16 deletions

View File

@@ -102,7 +102,7 @@ fi
# Automatically start X on login after boot.
# Do not use exec so that the zlogout is still read.
if command -v startx &>/dev/null && [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]]; then
if (( $+commands[startx] )) && [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]]; then
startx
exit $?
fi