EDIT: would be better say “blank” instead of "turn off"
EDIT2: Seems not possible, due limits of xset and X11? :
I hooked a second monitor using the HDMI output.
Usually, when I wanted to turn off the laptop’s monitor (LVDS1), I used to have two methods:
close the laptop’s lid (in /etc/systemd/logind.conf I set
HandleLidSwitch=ignoreto do nothing: just turn off the screen: I can say it because as I almost close the lid, I can see that it simply turn off)
using a bash script wich contain:
xset -display :0 dpms force off
Now that I have the second monitor on HDMI, the second method (
xset -display :0 dpms force off) turn off both screens instead of only the laptop’s monitor.
I am aware of
xrandr --output LVDS1 --off to turn off the laptop’s screen and of
xrandr --output LVDS1 --auto to turn on the laptop’s screen, but doesn’t work as expected: was better using
xset -display :0 dpms force off, because to reactivate it I just had to move the mouse or press any key on the keyboard; furthermore, the xrandr method, deactivate my screens layout (HDMI extended on the right). xset instead and again, didn’t deactivate the screens layout.
- Closing the lid, works as expected and flawlessly but I would use a bash script (which I can call with keyboard schortcut, also when I am distant from the laptop, thanks to wireless keyboad).
- Such script was
xset -display :0 dpms force offbut turn off both screens (but as I’ve said is enough to move mouse or press keyboard to reactivate)
xrandr --output LVDS1 --offdoesn’t work as I would and like: deactivate screens layout and I can’t reactivate the screen using mouse and keyboard as instead xset does.
There is a method to have the same behaviour of lid closing using a bash script? Or maybe by changing the xset script?