Talk:Start X at login

From ArchWiki
Revision as of 18:06, 1 February 2014 by EscapedNull (Talk | contribs) (Using systemd: Not sure where to go from here.)

Jump to: navigation, search

Discuss major edits

If you are going to make significant changes to pages that have an impact on people's ability to, among other things, login to an active session, please discuss them beforehand...

Jasonwryan (talk) 09:26, 29 May 2013 (UTC)

Graphical logins in multiple VTs

The note suggests using -lt, but in an SSH login, XDG_VTNR is unset, and the less-than comparison succeeds. (My bash version is: GNU bash, version 4.2.45(2)-release (x86_64-unknown-linux-gnu)). Thus, whenever I log in via SSH, startx is executed. Is this the right behaviour, or am I doing something wrong? Should we change the note to

[[ -z $DISPLAY && -n $XDG_VTNR && $XDG_VTNR -lt 3 ]] && exec startx

--Murukesh (talk) 17:00, 8 January 2014 (UTC)

Using systemd

Can this be done with systemctl --user? I think this method could be advantageous over the methods listed already, as it is shell-independent. I'd like to add it to the wiki once I figure it out.

Here's what I have:

~/.config/systemd/user/startx
[Unit]
Description='startx'
After=getty@tty1.service

[Service]
Type=simple
ExecStart=/usr/bin/startx

[Install]
WantedBy=getty@tty1.service

systemctl --user start startx works, the only problem is getting it to work automatically at login. I've already run systemctl --user enable startx. Ideas?

I doubt that your service will work, it does not solve the session permissions. See systemd/User for more information. Also note that there is no official approach yet. -- Lahwaacz (talk) 16:17, 1 February 2014 (UTC)
I guess I need to learn more about systemd, logind, and what exactly a "session" is before I try to devise a better solution. Hopefully we'll all be using Wayland by then anyway. For now, I don't have a problem typing "startx" after the few times a year that I reboot. I was just being optimistic in finding a shell-independent method for automatically starting X. EscapedNull (talk) 18:06, 1 February 2014 (UTC)