summaryrefslogtreecommitdiff
path: root/home/xyz/.profile
diff options
context:
space:
mode:
authorxyz <gky44px1999@gmail.com>2021-12-15 21:40:10 -0800
committerxyz <gky44px1999@gmail.com>2021-12-15 21:40:10 -0800
commitb4e672a86e91dbcd67cf94adc957cc550d19fed4 (patch)
tree317478cfab4cd1639e55e6ccb3a90881bc026aa7 /home/xyz/.profile
parentaa5c8969341aa5997e10d9e20599b10196fce5d2 (diff)
.profile, avoid a bash warning/error message
Diffstat (limited to 'home/xyz/.profile')
-rw-r--r--home/xyz/.profile3
1 files changed, 2 insertions, 1 deletions
diff --git a/home/xyz/.profile b/home/xyz/.profile
index 491155ea..2fe45244 100644
--- a/home/xyz/.profile
+++ b/home/xyz/.profile
@@ -85,6 +85,7 @@ export SCR_HEIGHT=900
[ -f "$HOME/.bashrc" ] && . "$HOME/.bashrc"
# startx when login, should be put after environmental variables for .xinitrc to use
-if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then
+# use `[ "$XDG_VTNR" ]` to avoid "-bash: [: : integer expression expected" warning/error message, when `sudo su - xyz` or ssh into a remote server, not sure if best practice or not
+if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then
exec startx
fi