X11 & Cinnamon: Set different rotation as normal value for display

0

Short version:
Can I set Cinnamon, or X11, that 'normal' for my touchscreen is actually 90° counterclockwise, ensuring this is not forgotten after a rotation?

Could I also set this system wide, including the terminal?

Background:
I have a 1Netbook One Mix Yoga 3s running Manjaro Cinnamon. The device is a small mini convertible netbook with tablet mode.

They manufacturer attached an 8.4'' screen in such a way, that "normal" orientation is actually rotated left 90°, aka portrait mode is default for this device.

It has an built-in accelerometer to adjust the screen orientation when the device is held in portrait mode or folded.

Usage scenario
For classical keyboard usage, the interface rendering needs to be rotated 90° counterclockwise, for example via xrandr -o 1 or Cinnamon's GUI Display setting "Counterclockwise".

The problem
Using Cinnamon's "Display" settings GUI enables correct rotation after the user logs in, but it forgets this as desired setting after a rotation occurred.

When rotating the device back horizontally, after using using the Netbook in portrait mode, the display is rendered upside down, aka rotated 90° clockwise.

Can I set sd-xrandr or xrandr to save 90° counterclockwise as "normal" or "0"? Because setting this in an X11 config files only works for logging in and before rotating for the first time, afterwards Cinnamon forgets "Counterclockwise" - With auto rotation set, xrandr -o 1 is getting ignored. Just xrandr raises another problem:

Another complication - Touchscreen There's a touchscreen, too. This needs proper rotation as well, which also doesn't seem to work when using just xrandr -o 1 and not Cinnamon's GUI based rotation setting.

Gymnae

Posted 2019-07-16T20:59:16.360

Reputation: 1

Answers

0

Solved by following advice from reddit: https://www.reddit.com/r/GPDPocket/comments/ce6jxr/onemix_3s_yoga_w_ubuntu_18042_how_do_i_tell_it/eu02dh8/

The trick was to go to the source of the problem, the accelerometer and change it's calibration.

Courtesy of /u/Lurker_00:

Create file /etc/udev/hwdb.d/61-sensor-local.hwdb with this content:

sensor:modalias:acpi:BOSC0200*:dmi*  
 ACCEL_MOUNT_MATRIX=-1, 0, 0; 0,1, 0; 0, 0, 1

(note a space in the beginning of the second line!) and run

sudo systemd-hwdb update

Gymnae

Posted 2019-07-16T20:59:16.360

Reputation: 1