#!/bin/bash # Recovery script for when Hyprland display goes black after lock/sleep. # This resets the display pipeline without killing your session. # Run from another TTY (Ctrl+Alt+F3). export XDG_RUNTIME_DIR=/run/user/$(id -u) # Find the Hyprland instance signature from the socket directory SIGNATURE=$(ls "$XDG_RUNTIME_DIR/hypr/" 2>/dev/null | head -1) if [ -z "$SIGNATURE" ]; then echo "Could not find Hyprland socket. Is Hyprland running?" exit 1 fi export HYPRLAND_INSTANCE_SIGNATURE=$SIGNATURE echo "Resetting display pipeline..." pkill hyprlock 2>/dev/null hyprctl dispatch dpms off sleep 1 hyprctl dispatch dpms on echo "Done. Switch back to Hyprland (Ctrl+Alt+F2)."