Talk:Start X at login
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...
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
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:
[Unit] Description='startx' Afterfirstname.lastname@example.org [Service] Type=simple ExecStart=/usr/bin/startx [Install] WantedByemail@example.com
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)