Solved Auto start XFCE from console

Hello,

I want to automatically start XFCE once I log into virtual console. ZSH is my shell in ttyv0, and I have added following in my .zshrc but its not working.
Code:
# start X11 after login on /dev/ttyv0 terminal
if [ $( tty ) = "/dev/ttyv0" ]; then
   nohup xinit -- -nolisten tcp -br -tst dpms nologo -xinerama -dpi 75 > /dev/null 2>&1 &
fi
Also I have following in my .xinitrc
Code:
exec /usr/local/bin/startxfce4 --with-ck-launch
I don't really get the code, got it from here http://daemonforums.org/showthread.php?t=883 How can I make this work?
 
Last edited:
Edit: Never mind, I was thinking of xenocara.
 
No need for a if…fi statement in .zshrc or an entry in .xinitrc.
In case of zsh simply create a .zlogin file and add
Code:
startx /usr/local/bin/startxfce4
You can put there any other program or script you wish to start automatically
after login from virtual console.
 
Code:
startx /usr/local/bin/startxfce4

On second thought that would initiate from every virtual console a X session attempt for
the same user on login. The .zshrc approach would be the better choice. Try:

.zchrc
Code:
if [ $( tty ) = "/dev/ttyv0" ]; then
  startxfce4 --with-ck-launch
fi

If this is no good replace “startxfce4 --with-ck-launch” with “xinit” and in addition

.xinitrc
Code:
exec /usr/local/bin/startxfce4 --with-ck-launch
 
I changed the code to
Code:
if [ $( tty ) = "/dev/ttyv0" ]; then
  startxfce4 --with-ck-launch
fi
like T-Daemon said and it worked :)

Thank you so much.
 
Back
Top