You are not logged in.
I'm using i3 desktop and I am trying to start an X session at boot.
According to the Arch wiki page on xinit, placing this statement:
if [ -z "$DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then
exec startx
fiin my .bash_profile will launch the session when I login.
The issue I am running in to is that the "DISPLAY" variable is set to ":1" leading to this statement being skipped.
Here is my .bash_profile:
#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc
if [ -z "$DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -le 3 ]; then
exec startx
fiAnd here is my .bashrc:
#
# ~/.bashrc
#
export TERM="rxvt-unicode-256color"
export XDG_CONFIG_HOME="$HOME/.config"
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
if [ -f "$HOME/.config/powerline/powerline.sh" ]; then
. $HOME/.config/powerline/powerline.sh
fi
alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
if [ -f $HOME/.bash_aliases ]; then
. $HOME/.bash_aliases
fiWhy is DISPLAY set before sourcing sourcing .bash_profile when it clearly shouldn't be? Thank you!
Last edited by Cougarium (2017-12-05 03:52:33)
Offline
The DISPLAY variable has no bearing on the code you are executing in your .bash_profile. Please paste the output of `ls -a $HOME`.
And, dont force your $TERM: it just breaks things.
Offline
The DISPLAY variable has no bearing on the code you are executing in your .bash_profile. Please paste the output of `ls -a $HOME`.
And, dont force your $TERM: it just breaks things.
.. Desktop git .npm .ssh .vscode
.bash_aliases .dmrc .gitconfig .nv .subversion .Xauthority
.bash_history Documents .gnupg .nvm Templates .xinitrc
.bash_logout Downloads .ICEauthority .omnisharp test.txt .Xresources
.bash_profile .dropbox .ipython Pictures Videos .xserverrc
.bashrc Dropbox .lesshst .pki .vim .xsession-errors
.bashrc.swp .dropbox-dist .local .psql_history .viminfo .xsession-errors.old
.cache .esd_auth Music Public .viminfo.tmp
.compton.conf .fehbg .node-gyp .python_history .viminfz.tmpHow can the DISPLAY variable not have any bearing on .bash_profile? If it is not set (if the string's length is zero) is what is being checked here.
Offline
the "DISPLAY" variable is set to ":1"
That's weird.
Just to confirm: if you log into TTY1 (without the conditionals in .bash_profile) then `echo $DISPLAY` produces ":1"?
I use this test instead:
[ "$(tty)" = "/dev/tty1" ] && exec startxDoes that work for you?
Last edited by Head_on_a_Stick (2017-12-04 07:39:28)
Jin, Jîyan, Azadî
Offline
Well, it'll be set by powerline, nvm or (to a lesser probability) the bash_aliases - just echo $DISPLAY before and after every sourcing and you'll see ...
Offline
Cougarium wrote:the "DISPLAY" variable is set to ":1"
That's weird.
Just to confirm: if you log into TTY1 (without the conditionals in .bash_profile) then `echo $DISPLAY` produces ":1"?
I use this test instead:
[ "$(tty)" = "/dev/tty1" ] && exec startxDoes that work for you?
Correct. And explicitly launching X on TTY1 doesn't work either ![]()
Offline
Alright, I didn't realize I couldn't have a GDM enabled. After disabling GDM the variable was not set.
Offline