I know that you can use the Screen Configuration tool from the desktop, but can I set this over ssh? Basically how can I use the Screen Configuration tool in the terminal on PI4?

3 Answers 3


I figured it out. Screen Configuration tool is just a GUI for XRandR. We can use,

DISPLAY=:0 xrandr --output $monitorName --rotate $orientation

Where $monitorName is the display name from the output of DISPLAY=:0 xrandr.

$orientation is left, right, inverted, or normal.

  • 4
    This does not seem to persist across reboots Feb 11, 2020 at 6:49
  • Where do I enter this? Which file/path?
    – tomh
    Feb 9, 2023 at 18:21

The "Screen Configuration" utility is indeed a GUI for XRandR. But the key is, it is actually editing a script that gets run at boot to make its changes persistent across reboots. Just calling XRandR, as Andrew Savinykh noted, will only apply the change until the next reboot.

The actual file that it modifies is /usr/share/dispsetup.sh. You can verify this by making a change, hitting the checkbox, then noting the change in the dispsetup.sh script.

Therefore, you can simply manually make your changes in dispsetup.sh (its just calling xrandr, so use man xrandr for syntax). Or you can copy the file from one Pi to another, etc.


EDIT: It seems that the process I described here no longer works with the raspberry PI 4

I didn’t even know that the raspberry PI 4 was a thing yet, haha.

I found a thread here that seems to cover the solution.

Basically, while in the terminal (or SSH) try editing the following config file like so:

sudo nano /boot/config.txt

And then adding ONE of the following flags at the bottom of the file depending on how you want the screen to rotate (don’t include the parts in parentheses):

display_rotate=0 (Normal)

display_rotate=1 (90 degrees)

display_rotate=2 (180 degrees)

It does look like this approach might also rotate the mouse movement, however if you are using SSH I get the feeling that this won’t be a problem for you.

  • 2
    This doesn’t work on the Pi 4. The work around is to use the screen configuration tool. But I’m looking for a way to do this though ssh Aug 2, 2019 at 19:11
  • @user1070953 I see... most results I’ve found don’t explicitly apply to or don’t work with the raspberry pi 4. I’ll keep looking, but I don’t own a PI 4 yet so I can’t try and crack the issue firsthand, sorry Aug 2, 2019 at 19:22
  • This definitely doesn't work on a Pi 4. Could someone write an answer that clearly explains how to boot to a desktop from the command line (ideally after quitting from a RetroPie installation?)
    – tomh
    Feb 9, 2023 at 18:20

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.