Pop_OS defaulting to inverted screen orientation

When booting up Pop_OS the display orientation defaults to inverted. This also happens whenever the laptop is rotated.

It can be fixed by inputting xrandr -o normal into the terminal but as mentioned above it still resets whenever rotated which causes a major annoyance.

Has anyone else encountered this and if so Is there a way to fix this?

Try this.

There is no file named that on the computer unfortunately

Same issue here on pop_os and spent the last couple hours going down the iio-sensor-proxy rabbit hole… the solution I found was to add local systemd sensor lookup rules as follows:

In the directory /sys/lib/udev/hwdb.d create a file named 61-sensor-local.hwdb with the following contents:

# Framework 12
sensor:modalias:platform:cros-ec-accel:dmi:*svnFramework:pnLaptop12*
 ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1

After that run the following commands:

sudo systemd-hwdb update

sudo udevadm trigger -v -p DEVNAME=/dev/iio:device1

sudo service iio-sensor-proxy restart

And it worked. You can run monitor-sensor –accel to see which orientation it thinks its in.

Edit: For those who have different new hardware and a similar issue, the file 60-sensor.hwdb in /sys/lib/udev/hwdb.d has direction on how to do this for any hardware at the top of the file as well as all the current lookup values for known hardware. This along with this 5 y/o reddit post and the Arch Wiki page on tablet PCs is about how I came to this solution.

1 Like

Thanks for the help, this fixed the issue

1 Like

Thank you, your solution was super helpful.
I had to change a few things for it to work for me:

  1. The directory of 61-sensor-local.hwdb is /lib/udev/hwdb.d
  2. I have a different DMI: dmi:*svnFramework:pnLaptop12(13thGenIntelCore):* (probably because i have the i3 version), so my 61-sensor-local.hwdb looks as follows:
# Framework 12 (13th Gen Intel Core)
sensor:modalias:platform:cros-ec-accel:dmi:*svnFramework:pnLaptop12(13thGenIntelCore)*
 ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1

You can check your exact DMI like so: cat /sys/class/dmi/id/modalias

  1. On newer Framework firmware, the cros-ec-accel devices don’t expose a MODALIAS, so the hwdb entry won’t actually apply. This was fixed by creating this rule:
sudo nano /etc/udev/rules.d/61-framework-accel.rules

with this content:

# Framework 12 - fix inverted accelerometer
ACTION=="add|change", KERNEL=="iio:device*", ATTR{name}=="cros-ec-accel", \
  ENV{ACCEL_MOUNT_MATRIX}="-1, 0, 0; 0, -1, 0; 0, 0, -1"

Then just run these commands:

sudo udevadm control --reload-rules
sudo udevadm trigger -v
sudo systemctl restart iio-sensor-proxy

I hope this helps, thanks again to @erkus : )