Best way to disable laptop monitor?

Hello,

Relatively new to using hyprland so maybe not the best question.

I like to work with my laptop monitor closed and use an external monitor.

I have this script

lid_state=$(cat /proc/acpi/button/lid/LID*/state 2>/dev/null | awk ‘{print $2}’)
if [ “$lid_state” = “open” ]; then
hyprctl eval ‘hl.monitor({ output = “eDP-1”, disabled = false })’
elif [ “$lid_state” = “closed” ]; then
hyprctl eval ‘hl.monitor({ output = “eDP-1”, disabled = true })’
fi

that is run on lid switch

hl.bind(“switch:Lid Switch”, hl.dsp.exec_cmd(“~/.config/hypr/scripts/lidcheck.sh”))

however whenever I save my config the monitor script is re-enabled and I have to open and close my laptop to disable the monitor. Because of this I have added this to my config.

hl.on(“config.reloaded”, function ()
hl.exec_cmd(“~/.config/hypr/scripts/lidcheck.sh”)
end)

Was wondering if there is a better way of doing this in hyprland where I don’t have to rerun this script on config save?