billypom

Hyprland tty login

2025-11-25

It is possible autostart hyprland without a login manager. To do this we just need to create/edit 4 files.

~/.bashrc


The contents in the file ~/.bashrc get executed when logging into an interactive shell. So we will use this functionality to our advantage.

Add this line to your ~/.bashrc

[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Hyprland >/dev/null 2>&1 && exec "~/.config/hypr/start.sh"
  • IF we are on TTY1 (CTRL + ALT + F1)
  • AND IF hyprland is not already running
  • THEN, execute our hyprland startup script

~/.config/hypr/start.sh


The hyprland startup script

#!/bin/sh
cd ~
export XDG_RUNTIME_DIR=/tmp/hyprland
mkdir -p $XDG_RUNTIME_DIR
chmod 0700 $XDG_RUNTIME_DIR
exec dbus-launch --exit-with-session Hyprland

~/.config/hypr/hyprland.conf


Add this line to your hyprland.conf

exec-once = $HOME/.config/hypr/portalstart

~/.config/hypr/portalstart


#!/bin/bash
sleep 1
killall xdg-desktop-portal-hyprland
killall xdg-desktop-portal-wlr
killall xdg-desktop-portal
/usr/libexec/xdg-desktop-portal-hyprland & sleep 2
/usr/libexec/xdg-desktop-portal &

This script starts all necessary XDG-desktop-portals. XDG-desktop-portals are d-bus services that allow applications to interact with the desktop in certain ways (drag & drop, screen-sharing, etc). So if you like using a computer the 'normal' way, you will want this.


#linux
#linux deskop
#hyprland