Based on @merge 's accelerometer work (https://email@example.com/) and yesterday's work to hook iio-sensor-proxy into #phosh, enabling rotation is just a couple of more lines of code.
The video shows the #librem5 devkit but it is the same for the phone. Please excuse the low video quality.
After adding proximity sensor-support to #iio-sensor-proxy (https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/merge_requests/298) and adding runtime-pm support for the chip used in the #librem5 (and it's devkit) (https://firstname.lastname@example.org/) we can now wire it up to #phosh to fade the screen and prevent keyboard input:
this laptop (MNT Reform) and this phone (Purism Librem 5) have the same SoC (CPU/GPU/...), i.MX8M. and both run free and open source drivers and software. #FOSDEM2020
How We Designed the Librem 5 Dev Kit with 100% Free Software
(An early glimpse on the) #librem5 's devkit graphics on Linux 5.x : https://source.puri.sm/guido.gunther/linux-imx8/tree/imx8-5.x-drm