2022-01-16 18:20:39 +00:00
|
|
|
---
|
|
|
|
title: "autologin"
|
2022-01-16 19:28:02 +00:00
|
|
|
tags: [ "Documentation", "Distros", "Arch" ]
|
2022-01-16 18:20:39 +00:00
|
|
|
---
|
2022-01-16 19:28:02 +00:00
|
|
|
|
2020-01-05 13:13:57 +00:00
|
|
|
# Automatic Login
|
2020-01-02 00:04:35 +00:00
|
|
|
|
2022-01-16 19:28:02 +00:00
|
|
|
Edit `/etc/systemd/system/getty@tty1.service.d/override.conf` by typing:
|
2020-01-02 00:04:35 +00:00
|
|
|
|
2020-01-05 13:13:57 +00:00
|
|
|
> sudo systemctl edit getty@tty1
|
2020-01-02 00:04:35 +00:00
|
|
|
|
2022-01-16 19:28:02 +00:00
|
|
|
The put in the following, changing `[ USER ]` to your username.
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
2020-01-05 13:13:57 +00:00
|
|
|
[Service]
|
|
|
|
ExecStart=
|
2022-01-16 19:28:02 +00:00
|
|
|
ExecStart=-/usr/bin/agetty --autologin [ USER ] -s %I 115200,38400,9600 vt102
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
2020-01-05 13:13:57 +00:00
|
|
|
# Automatically Start X
|
2020-01-02 00:04:35 +00:00
|
|
|
|
2022-01-16 19:28:02 +00:00
|
|
|
In `.bashrc`.
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
if [ -z "$DISPLAY" ] && [ "$(fgconsole)" -eq 1 ]; then
|
|
|
|
exec startx
|
|
|
|
fi
|
|
|
|
|
|
|
|
```
|