Disabling a monitor with the new lua config

I have been using hyprctl keyword monitor eDP-1 disable to turn off my laptop screen. But this doesn’t work with the newer lua config, but I cannot figure out what should work.

My best attempt is `hyprctl eval ‘hl.exec_cmd(“keyword monitor eDP-1, disable”)’` which does return “ok” but does nothing. (or the various other combinations I’ve been trying)

hyprctl eval 'hl.monitor({ output = "eDP-1", disabled = true })'

And I think that formatting will give me enough of a hint to get the rest of the similar things working. Thank you.

Classically, that was enough to get a bunch of other things working (such as dpms commands in hypridle), but for the life of me I can’t figure out how to massage it into a bind.

Not sure what massaging bind you have in mind but if it is for disabling the monitor, this would suffice.

hl.bind(mainMod .. " + F1", function()
hl.monitor({
output = “eDP-1”,
disabled = true
})
end)

Change the binds to your liking.

I swear I tried that…

Working now.

If you want a toggle I just wrote this up earlier

function mToggle()
  if hl.get_monitor("eDP-1") ~= nil then
    hl.monitor({ output = "eDP-1", disabled = true })
  else
    hl.monitor({ output = "eDP-1", disabled = false })
  end
end

hl.bind(mainMod .. " + SHIFT + M", mToggle)

Cheers