Auto Login to Hyprland
This guide configures your system to bypass the login prompt and automatically launch Hyprland upon boot. Perfect for single-user machines.
Overview
Section titled “Overview”The setup involves three steps:
- Disable any existing display manager (SDDM/GDM)
- Configure TTY1 for automatic login
- Auto-launch Hyprland from your shell
Step 1: Disable Display Manager
Section titled “Step 1: Disable Display Manager”If you have SDDM or another display manager installed:
sudo systemctl disable sddm.serviceDo not use --now flag as it will immediately crash your current graphical session.
Step 2: Configure TTY1 Auto-Login
Section titled “Step 2: Configure TTY1 Auto-Login”Create the systemd override directory:
sudo mkdir -p /etc/systemd/system/getty@tty1.service.d/Create the override file:
sudo nvim /etc/systemd/system/getty@tty1.service.d/override.confAdd the following content (replace YOUR_USERNAME with your actual username):
[Service]ExecStart=ExecStart=-/usr/bin/agetty --autologin YOUR_USERNAME --noclear --noissue %I $TERMConfiguration Breakdown
Section titled “Configuration Breakdown”| Parameter | Description |
|---|---|
ExecStart= | Clears the default command |
--autologin YOUR_USERNAME | Performs automatic login for the specified user |
--noclear | Preserves boot messages on screen |
--noissue | Skips displaying /etc/issue |
Step 3: Auto-Launch Hyprland
Section titled “Step 3: Auto-Launch Hyprland”Add the following to the end of your ~/.zshrc (or ~/.bash_profile for Bash):
Recommended Method (Robust)
Section titled “Recommended Method (Robust)”# Automatically start Hyprland on TTY1if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then if uwsm check may-start; then exec uwsm start hyprland.desktop fifiThis script:
- Checks if no graphical session is running (
$DISPLAYis empty) - Verifies we’re on TTY1
- Uses UWSM (Universal Wayland Session Manager) to safely start Hyprland
Simple Method
Section titled “Simple Method”# Simpler auto-start for Hyprlandif uwsm check may-start; then exec uwsm start hyprland.desktopfiVerification
Section titled “Verification”After making these changes, reboot your system:
sudo rebootYour system should automatically log in and launch Hyprland without any prompts.