# 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 Hyprland >/dev/null 2>&1 || return 0 # Skip if flag file exists (touch ~/.skip-hyprland to disable) [ -f "$HOME/.skip-hyprland" ] && return 0 # Setup logging (same pattern as start-hyprland wrapper) _hypr_log_dir="$HOME/.local/var/log" mkdir -p "$_hypr_log_dir" _hypr_log="$_hypr_log_dir/hyprland-$(date +%Y-%m-%d-%H%M%S).log" # Clear screen and start Hyprland (no exec = return to shell on exit) clear Hyprland >"$_hypr_log" 2>&1 # Hyprland exited - inform user echo "Hyprland session ended. Type 'start-hyprland' to restart." unset _hypr_log_dir _hypr_log