How to rotate display in vim4

How to rotate display in vim4 without using settings. Ubuntu 22.04.

I would like to do this operation in terminal. xrandr is not working at wayland.

In the Wayland environment, xRandr cannot function properly.

yes, I said the same thing. what do I use to change the orientation from the terminal? is there a way to do this?

@ozgedurgut
I tried switching to xorg, but the result was equally bad. there is currently no suitable method and can only rely on the graphical interface.
http://docs.khadas.com/products/sbc/vim4/troubleshooting/x11-fixup

khadas@Khadas:~$ wlr-randr
compositor doesn't support wlr-output-management-unstable-v1

cd /tmp/
apt download libgbm1
dpkg -x libgbm1_*.deb libgbm1
sudo rm /usr/lib/aarch64-linux-gnu/libgbm.so.1.0.0
sudo cp libgbm1/usr/lib/aarch64-linux-gnu/libgbm.so.1.0.0 /usr/lib/aarch64-linux-gnu/
sync

I did these steps in terminal. What should I do now?

Reboot, then select in the lower right corner of the login interface ‘Ubuntu on Xorg’.

@ozgedurgut you can rotate the display orientation of desktop in wayland itself, so you can maintain GPU acceleration for smooth desktop:

Unlike X11 compositor which used to manage the display rotation previously, Under gnome Wayland this attribute is handled by mutter now.

you can follow these steps to manage the display rotation for gnome desktop

  1. Download this helper script:
$ wget https://gitlab.com/Oschowa/gnome-randr/-/raw/master/gnome-randr.py
  1. Identify the display:
$ python3 gnome-randr.py

I identify my display under HDMI-1:

  1. Run the command to rotate it:
$ python3 gnome-randr.py --output HDMI-1 --rotate left

your options to rotate may be normal/left/right/inverted

Regards.

2 Likes


It worked on my first try, but failed on subsequent tries. Both Khadas’ own screen is connected and a monitor is connected via HDMI.

@ozgedurgut you need to specify a primary monitor and add the right-of/left-of/above/below argument also.

1 Like

After setting primary, I was able to rotate the screen in the direction I wanted in subsequent attempts. However, if an external monitor is connected to Khadas, that is, if I rotate HDMI-1, the image goes to the main screen of Khadas. It does not give an error. When I remove the HDMI, the image comes to the screen of Khadas, when I plug the HDMI in, there is image on both, but when I do something like “$ python3 gnome-randr.py --output HDMI-1 --rotate left” again, the image on the screen of Khadas goes and the screen goes black.

Also, when I want to rotate the DSI-1, I get a black screen again.

If there is no external monitor connected and only Khadas’s own screen is connected, this command line works and I can rotate the Khadas screen.

@ozgedurgut it will be disabled based on the display orientation configuration, if you have set an odd configuration which doesn’t align the two screens, the secondary display will be made blank.

What do you mean by aligning the two screens? What do I need to do to make both work?

@ozgedurgut the displays should have their top bars (the one with the clock and other tabs) aligned in the same direction:

something like this:

Can you share what is your desired display configuration ?

Hello, I can run this gnome-randr script when I write the command directly to the terminal and the result is successful. Similarly, when I run this command with os.system in a python code, the result is successful.


                            os.system("chmod +x ~/gnome-randr.py")
                            os.system("python3 ~/gnome-randr.py --output DSI-1 --off")

I convert this python code application to an exe with PyInstaller and when I run it with ./my_app , the command I wrote with gnome-randr.py works and the result is successful. However, when I start this exe with a service, the command I wrote with gnome-randr.py does not work, the result is unsuccessful. The output of the service is as follows;

@ozgedurgut have you tried to execute the service normally by launching with python directly instead of making executable with pyinstalled ?