Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Starting X11 on console login
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2583

PostPosted: Wed Oct 01, 2014 1:17 pm    Post subject: Starting X11 on console login Reply with quote

Just trying with https://wiki.gentoo.org/wiki/X_without_Display_Manager#Starting_X11_on_console_login but doesn't work for me.

For me, echo $XDG_VTNR returns nothing, on any tty.
Where should it come from, which program would set XDG_VTNR?
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10306
Location: Córdoba (Spain)

PostPosted: Wed Oct 01, 2014 2:57 pm    Post subject: Reply with quote

I have no idea what $XDG_VTNR or whatever it's called is :P

I have always used this:

Code:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty5 ]; then
  sleep 1
  startx&exit
fi


Adjust tty accordingly ;)
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3376

PostPosted: Wed Oct 01, 2014 5:08 pm    Post subject: Reply with quote

i92guboj wrote:
I have no idea what $XDG_VTNR or whatever it's called is :P

I have always used this:

Code:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty5 ]; then
  sleep 1
  startx&exit
fi


Adjust tty accordingly ;)


Why do you sleep in there? Doesn't seem like anything is racy to me...
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2583

PostPosted: Thu Oct 02, 2014 11:01 am    Post subject: Reply with quote

i92guboj wrote:
I have always used this:

Code:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty5 ]; then
  sleep 1
  startx&exit
fi
Yes, that looks more familiar to me. But still wondering about ${XDG_VTNR} as from the wiki article.
Back to top
View user's profile Send private message
potuz
Guru
Guru


Joined: 30 Jan 2010
Posts: 378

PostPosted: Fri Oct 03, 2014 10:56 am    Post subject: Reply with quote

charles17 wrote:
i92guboj wrote:
I have always used this:

Code:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty5 ]; then
  sleep 1
  startx&exit
fi
Yes, that looks more familiar to me. But still wondering about ${XDG_VTNR} as from the wiki article.

Are you using systemd? That variable is set now by systemd-logind. Did you by any chance change the default /etc/pam.d/login.
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10306
Location: Córdoba (Spain)

PostPosted: Fri Oct 03, 2014 11:16 am    Post subject: Reply with quote

depontius wrote:
i92guboj wrote:
I have no idea what $XDG_VTNR or whatever it's called is :P

I have always used this:

Code:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty5 ]; then
  sleep 1
  startx&exit
fi


Adjust tty accordingly ;)


Why do you sleep in there? Doesn't seem like anything is racy to me...


If I modify it this way you'll surely understand :lol:

Code:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
  echo "Control+C to use CLI"
  sleep 1
  startx&exit
fi


This must be the last thing in your config file, otherwise you might skip something important when aborting the script.

Admittedly it's weird and getting used to that timing takes a bit, so you might want to increase the time to 4 or 5 seconds at least, but it works quite well. I've been using this probably for more than a decade. :D
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
potuz
Guru
Guru


Joined: 30 Jan 2010
Posts: 378

PostPosted: Fri Oct 03, 2014 11:21 am    Post subject: Reply with quote

Still XDG_VTNR gets parsed in lots of places and having it unset is sign of a problem. If you're using systemd could you paste the return of
Code:
loginctl show-session $XDG_SESSION_ID
Back to top
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10306
Location: Córdoba (Spain)

PostPosted: Fri Oct 03, 2014 11:29 am    Post subject: Reply with quote

I haven't it set, and I have never heard of it. It's probably something that the freedesktop people invented recently (they do that all the time so that's no surprise). A grep -R on /etc shows that var is not used anywhere, and it is not used in /usr/bin/startx either. Running "apropos XDG_VTNR" doesn't return anything. So, it seems it's not as widely used after all :roll:

It's probably a systemd/logind thing.

That wiki should be probably revised and provide a valid alternative for those that don't use systemd.
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2583

PostPosted: Fri Oct 03, 2014 3:46 pm    Post subject: Reply with quote

potuz wrote:
Are you using systemd? That variable is set now by systemd-logind. Did you by any chance change the default /etc/pam.d/login.
No, I'm definitely not using systemd.
Just studied again that section on https://wiki.gentoo.org/wiki/X_without_Display_Manager#Starting_X11_on_console_login and I cannot find it's written for only systemd as "X11 autologin with systemd" starts one section below.
Either the content is wrong or this paragraph belongs to the systemd section. Or am I wrong???
Back to top
View user's profile Send private message
potuz
Guru
Guru


Joined: 30 Jan 2010
Posts: 378

PostPosted: Fri Oct 03, 2014 11:12 pm    Post subject: Reply with quote

charles17 wrote:
potuz wrote:
Are you using systemd? That variable is set now by systemd-logind. Did you by any chance change the default /etc/pam.d/login.
No, I'm definitely not using systemd.

Then that's it. That wiki should be edited. XDG_VTNR is set by systemd-logind (or any window manager hooked to systemd) using pam_setenv(). It's mainly used by windows managers which you don't care anyway (after all that wiki was about not using one).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum