Redirect the live autologin compositor's stdout/stderr to /var/log/hyprland-live.log, and on exit drop to an interactive shell showing the return code instead of letting the getty autologin respawn-loop hide any startup failure behind a blank blinking cursor. Makes a failed live boot diagnosable and leaves the medium usable.
19 lines
1.2 KiB
Bash
19 lines
1.2 KiB
Bash
# Auto-start Hyprland on tty1 in the live session
|
|
if [[ "$(tty)" == "/dev/tty1" ]] && [[ -z "$WAYLAND_DISPLAY" ]]; then
|
|
# Allow a software-rendering fallback so the live session comes up even
|
|
# without a GPU (VMs, headless, exotic hardware). On real hardware wlroots
|
|
# still selects the hardware renderer; this only permits llvmpipe when no
|
|
# GPU renderer is available. Must be exported before Hyprland starts —
|
|
# wlroots reads it at renderer init, earlier than any Hyprland `env=` line.
|
|
export WLR_RENDERER_ALLOW_SOFTWARE=1
|
|
# Software cursors: hardware-cursor planes are often unusable in VMs and
|
|
# show as invisible/garbled; this is the reliable choice for a live medium.
|
|
export WLR_NO_HARDWARE_CURSORS=1
|
|
# Run the compositor, capturing its output so a failed live boot is
|
|
# diagnosable (Hyprland also keeps its own log under $XDG_RUNTIME_DIR/hypr/).
|
|
# On exit, drop to an interactive shell with the error in view instead of
|
|
# letting the getty autologin respawn-loop hide it behind a blank cursor.
|
|
Hyprland &>/var/log/hyprland-live.log
|
|
echo "Hyprland exited (rc=$?). Log: /var/log/hyprland-live.log"
|
|
exec bash -i
|
|
fi
|