"DISPLAY=:0.0 xrandr --output HDMI-1 --off" changes layout of Pi

The Raspberry Pi is a series of credit card-sized single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and developing countries.

Post Reply
User avatar
/RaspberryPi
Corporate
Posts: 2449
Joined: Wed Jun 05, 2019 1:29 am

"DISPLAY=:0.0 xrandr --output HDMI-1 --off" changes layout of Pi

Post by /RaspberryPi »


Hello,

Pi use case: Magic Mirror with a picture slide show in a vertical layout (display_rotate=3)

Desired function: Turn off display every night and turn it back on during the day

What I tried:

"vcgencmd display_power 0" seems to be deprecated so I found the command "DISPLAY=:0.0 xrandr --output HDMI-1 --off"

However when I turn back on the display using "DISPLAY=:0.0 xrandr --output HDMI-1 --auto" it switches my format to horizontal instead of vertical.

My workaround is to turn off the display at night and reboot the Pi in the morning. I'm fine with it, but was wondering if there was a way to achieve what I actually want to do.


submitted by /u/CalmHabit3
[link] [comments]

Source: https://www.reddit.com/r/raspberry_pi/c ... es_layout/
/RaspberryPi
Post Reply

Return to “Raspberry Pi Forum”