BashScripts icon indicating copy to clipboard operation
BashScripts copied to clipboard

turn-off-monitors doesn't handle the case when in an ssh session with an X11 client and a Wayland server.

Open Erotemic opened this issue 10 months ago • 0 comments

I ssh into a wayland laptop from an X11 host machine, and I noticed the turn-off-monitors script might not behave correctly in this circumstance.

Perhaps the case is niche, but I figured I'd report it. In my ssh config I have:

ForwardX11 yes ForwardX11Trusted yes

I'm not sure if this does anything when running wayland on the server. In the ssh session echo $XDG_SESSION_TYPE is tty, so it ends up just running sleep 0.5; xset dpms force off, which causes the screen on my host machine to turn off, and not the laptop. (I figure because it is forwarding the x11 command to my host?).

However, if I just run:

    busctl --user set-property org.gnome.Mutter.DisplayConfig /org/gnome/Mutter/DisplayConfig org.gnome.Mutter.DisplayConfig PowerSaveMode i 1

in the ssh session, it does turn the screen on the laptop off, which is what I want.

Erotemic avatar Mar 06 '25 18:03 Erotemic