1

I tried xrandr --output 'HDMI-A-1' --off which puts the screen as black for only a few seconds and doesn't turn anything off. xset -display :0.0 dpms force off does the same except it shows me the lock screen afterwards

The only time I ever seen linux turn off my screen is when I boot up my PC and not log in

2
  • what do you mean by turn off?
    – jsotola
    Apr 22, 2022 at 15:27
  • I have never seen an operating system actually turn off a screen. The OS just stops using it (turns it black) and then the screen itself may turn off after a while automatically. The question is why your xrandr command is being undone and what undoes it. What operating system is this? You mentioned Linux, but which one? And what graphical environment? Is this X or wayland?
    – terdon
    Apr 22, 2022 at 15:38

1 Answer 1

3

If you have multiple displays and wish to turn one of them off, you should use Xfce's display settings dialog for that.

If you use the xrandr command while Xfce is also controlling the display settings, Xfce might promptly restore the state configured for it, overriding your xrandr command - which would match what seems to be happening to you.

If you have just one display, turning it off with xrandr would leave the X11 server (and your GUI session) with no functional screens, and it won't like that at all. It will re-detect screens, "find" your screen again and effectively override your command.

To enable the screensaver, you should rather use xfce4-screensaver-command --activate or similar. Typically, this first just turns the screen black, then (optionally) enables a DPMS power-save mode after a configurable number of minutes.

Since letting the screen power down completely makes it slower to power up again than just making the screen black, there is usually a delay of a minute or two after the screensaver starts before a power-save mode kicks in. That enables a faster response if you are e.g. presenting a document and the screensaver accidentally kicks in while you are talking.

(Actual presentation applications usually override the screensaver when in "presentation mode", but perhaps you're presenting something using a plain Web browser or some other program?)

2
  • xfce4-screensaver-command --activate had my screen go blank for about 12.5seconds (tried it twice timing with my phone) before going to the lock screen. I still have 0 idea what I can do but everything you said seems to make sense. I have 2 screens connected but I only have the one on. Only one seems to be detected Apr 22, 2022 at 20:01
  • That's rather specific to xfce.
    – Auspex
    Oct 15, 2023 at 14:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .