[artix-general] Is console autologin possible to start X automatically on Artix?

Stefan Mark mark at unserver.de
Mon Jun 3 10:14:21 EEST 2019


On 29.05.19 09:21, Javier via artix-general wrote:
On 5/28/19 2:21 PM, Javier via artix-general wrote:
> Hi,
>
> I'm using on Arch console autologin [1] to then auto start X at login [2].  The auto login is mentioned on Arch to be possible due to systemd, however it seems more like a getty + logind artifact.  I'm wondering, as elogind is part of Artix, if autologin is also possible on Artix.
>
> Not that one can't live without it, just that it's really convenient to me.  If you're wondering, I'm always starting with the screen blocked prior to calling the DE/WM on xinitrc...
>

Using openrc its simple (should be similar for runit). Each virtual
console has its own config /etc/conf.d/agetty.ttyX, where X is 1 to 5.
Chose one (or create another one, at least 1-9 should be no problem) and
add "-a USERNAME" to the config string. This will make agetty to
autologin USERNAME on virtual console X.

Now, open ~/.bash_profile and add after the shebang (remember to replace
X in ttyX):

if [ "$(tty | sed -e "s:/dev/::")" == "ttyX" ]; then
  exec startx
fi

this will start X when logged in on console X.

This has nothing to do with elogind though, but i hope it helps
nevertheless.


Notes:
Due to the "exec" before "startx" the shell is exited and replaced by
startx. After X ends the user will log out. And then in again due to the
"-a" on agetty. If anything goes wrong: Loop time (at least on Gentoo
the startup scripts from X have their own loop protection). You can
remove the "exec", then you end up logged in a console after X exited
(since the console (usually) has no screen lock, this might be a bad
thing). Choose wisely.

Obviously, the agetty and the bash_profile part can be used
independently to either automatically start X on manual login, or
automatically login without starting X.

Do i have to mention that automatic login might be a security issue?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.artixlinux.org/archives/artix-general/attachments/20190603/bff0427b/attachment.sig>


More information about the artix-general mailing list