Files
hypr/scripts/fix-hyprlock.zsh
T

24 lines
853 B
Bash
Executable File

#!/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