From 16f9e8d25681eaf2d6d7767f8e525714f5ab5aba Mon Sep 17 00:00:00 2001 From: Trey Blancher Date: Mon, 23 Nov 2026 20:10:27 -0500 Subject: [PATCH] Updated fix-hyprlock script for new Lua function --- scripts/fix-hyprlock.zsh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 scripts/fix-hyprlock.zsh diff --git a/scripts/fix-hyprlock.zsh b/scripts/fix-hyprlock.zsh new file mode 100755 index 0000000..7bb3c7c --- /dev/null +++ b/scripts/fix-hyprlock.zsh @@ -0,0 +1,23 @@ +#!/usr/bin/env zsh + +instance="${HYPRLAND_INSTANCE_SIGNATURE:-0}" + +if [[ "$1" == "--help" || "$1" == "-h" ]]; then + echo "Usage: $(basename "$0") [OPTIONS]" + echo "" + echo "Recover from a crashed Hyprlock screen in Hyprland using the Lua/eval API." + echo "" + echo "Options:" + echo " (default) Allow session lock restoration and relaunch hyprlock" + echo " -c, --clear Clear the crashed lockscreen state and return to desktop" + echo " -h, --help Show this help message" + exit 0 +fi + +if [[ "$1" == "--clear" || "$1" == "-c" ]]; then + killall -9 hyprlock + hyprctl --instance "$instance" eval 'hl.clear_crashed_lockscreen()' +else + hyprctl --instance "$instance" eval 'hl.config({ misc = { allow_session_lock_restore = true } })' + hyprctl --instance "$instance" eval 'hl.dispatch(hl.dsp.exec_cmd("hyprlock"))' +fi