[profile] don't startx if command does not exist

This commit is contained in:
odrling 2023-07-30 22:31:32 +02:00
parent ff64aeac88
commit 9af22202cb
No known key found for this signature in database
GPG key ID: A0145F975F9F8B75

View file

@ -20,6 +20,15 @@ export PATH="$HOME/.local/bin:$HOME/.local/odrbin:$PNPM_HOME:$PATH:$HOME/.luaroc
[ -e "$HOME/.nix-profile/etc/profile.d/nix.sh" ] && . "$HOME/.nix-profile/etc/profile.d/nix.sh"
if [ "$(tty)" = '/dev/tty1' ]; then
if test -z "${XDG_RUNTIME_DIR}"; then
export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir
if ! test -d "${XDG_RUNTIME_DIR}"; then
mkdir "${XDG_RUNTIME_DIR}"
chmod 0700 "${XDG_RUNTIME_DIR}"
fi
fi
ulimit -c unlimited
if command -v startx > /dev/null && [ "$(tty)" = '/dev/tty1' ]; then
pgrep xinit || exec startx
fi