Add example to config describing how to power off monitors after locking
With the current default behavior, Mod + Alt + L opens swaylock, but doesn't power off monitors. The config should include a commented out example showing how to add the power-off after logging out.
Oh, that's an interesting way to do it.
I am also using swayidle in pretty much the same way.
(Side note: I prefer the wlopm tool over compositor-specific commands like power-off-monitors. I'll hopefully have some time soon to add wlr-output-power-management-v1 to niri)
I configured it like this, I guess this could be added to the example config?
Super+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn-sh "niri msg action power-off-monitors ; swaylock";}
Yeah, one can use niri's own ipc mechanism to turn monitors off. Buut, if niri supported wlr-output-power-managment-v1, one could do that in a compositor agnostic way
sure, but I do not quite get why you need to do that in a compositor agnostic way while using a specific compositor. anyhow I think this example is good enough for the documentation and saves people from googling around.
because that way, you can have scripts that don't depend on a compositor. You can play/try other compositors and a lot of stuff will just keep working.
f.e. I have a script to focus an open window or launch an app (using fuzzel). Since I discover wlrctl, I replace the part of the script for the window selection from using niri msg to using wlrctl.
In the end its just preference, but I like not depending on compositors IPCs mechanisms