0

I want to find a way to turn on and off a HDMI connected display with simple command. In past it used to be something with xrandr, but due to linux forever evolving, it is not working anymore.

i tried : sudo xrandr --output XWAYLAND0 --off > not working sudo vcgencmd display_power 0 > not working sudo xset dpms force off > not working

sudo or non sudo is same result... what it seems is that instead of something like HDMI-0, there is XWAYLAND0 as name of display

talking to chat gpt and searching the internet... like forever. This is second day i am trying to figure this out... Every time i am looking for a simple answer to a simple problem i am getting reminded why i hate linux so much... there just cannot be a simple solution, everything need to be overcomplicated. (rant)

1
  • I feel your pain. OTOH, you could be dealing with a system like macOS - controlled by the world's largest corporation which actively limits and denies documentation to its users. Which one do you think works best for "people like us"?
    – Seamus
    Dec 26, 2023 at 22:25

1 Answer 1

1

As you're no doubt aware, Wayland is new. In LinuxWorld, new often equates to poorly documented. I wonder if you might have better luck using the older, but better-documented graphics system: X??

I run all of my systems headless, but AIUI you can switch from Wayland to X using the raspi-config utility. Start raspi-config from the command line by entering the following:

sudo raspi-config  

When the menu presents, select 6 Advanced Options, and the sub-menu will list more options including A6 Wayland Switch between X and Wayland backends. Switch to X, and your older commands should (may?) work.

There are also a couple of "lower-level" solutions that may allow you to keep Wayland if you're inclined:

vcgencmd display_power 0  # `0` turns OFF; `1` turns ON

alternatively, install cec-utils & use that:

sudo apt update
sudo apt install libcec3 cec-utils
echo 'standby 0' | cec-client -s -d 1    # turns OFF
echo 'on 0' | cec-client -s -d 1         # turns ON
REFERENCES (all obtained via search engine `raspberry pi HDMI interface`):
  1. How to automatically turn off and on your monitor from your Raspberry Pi
  2. Using HDMI-CEC on a Raspberry Pi
4
  • Thanks Seamus, i will try both later and write if it worked. Seems not using the latest everything in Raspberry OS is better choice for common users. I can only wish RPI foundation would not push buggy ( = not battle and time proven ) software onto its users. Jan 2 at 9:28
  • @dingo27mobile: That's why I run headless.
    – Seamus
    Jan 2 at 18:52
  • I am somehow loosing comments here all over the stackexchange... strage. Anyways, i want to srite again that i usually use it headless too but i borked the system and can see only standard debian wallpaper (debian logo in middle), even mouse cursor stopped working and i cannot start anything via menu. At least i was able to dowload everything from pi via samba, so yeah, currently i "love" linux so much. I will reinstall whole system once again when i feel like it, probably after few months... Jan 2 at 20:36
  • @dingo27mobile: Did this answer solve your problem?
    – Seamus
    Jan 2 at 22:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.