summaryrefslogtreecommitdiff
path: root/dotfiles/hyprland/.profile.d/99-hyprland-autostart.sh
blob: 753fdce2ebe9707942d8d70bf77edcd7b9063f93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 99-hyprland-autostart.sh
# Auto-start Hyprland on TTY1 console login

# Guard: only on TTY1, not SSH, no existing display
[ "$XDG_VTNR" = "1" ] || return 0
[ -z "$SSH_TTY" ] || return 0
[ -z "$WAYLAND_DISPLAY" ] || return 0
[ -z "$DISPLAY" ] || return 0
command -v start-hyprland >/dev/null 2>&1 || return 0

# Skip if flag file exists (touch ~/.skip-hyprland to disable)
[ -f "$HOME/.skip-hyprland" ] && return 0

# Clear screen and start Hyprland via watchdog wrapper
clear
start-hyprland

# Hyprland exited - inform user
echo "Hyprland session ended. Type 'start-hyprland' to restart."