Thursday | 21 NOV 2024
[ previous ]
[ next ]

Arch Linux Auto Login

Title:
Date: 2023-10-27
Tags:  

I want to push the power button on my computer and walk away. When I come back I should be good to go.

Create the systemd directory:

sudo mkdir /etc/systemd/system/getty@tty1.service.d

Create the service file:

sudo vim /etc/systemd/system/getty@tty1.service.d/autologin.conf

Add the following:

[Service]
ExecStart=
ExecStart=/sbin/agetty -o '-p -f -- \\u' --noclear --autologin username %I $TERM 

Now we can reboot and we should get logged in automatically.

To start sway automatically with fish as the shell, add the following to ~/.config/config.fish:

if test -z "$DISPLAY" -a (tty) = "/dev/tty1"
   exec sway --unsupported-gpu
end

We should now be able to log in automatically and start up sway as well. I have my sway config set up to automatically open 3 terminals, a browser, a browser aimed at chatgpt and a notepad file.