Feature: native 2-in-1 screen auto-rotation (tablet mode) support #9427
VisorDTE
started this conversation in
Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Add out-of-the-box support for automatic screen + touchscreen rotation on 2-in-1 / convertible laptops. Currently it is not working and requires manual setup, and the most obvious AUR helper is broken on Omarchy's Hyprland version.
Environment
Root cause (why rotation doesn't work today)
iio-sensor-proxyis not installed by default, so no orientation events ever reach the compositor. The hardware sensors are present and functional (accel_3d,incli_3d,dev_rotation,hinge,gyro_3d, etc.).Hyprland does not auto-rotate by itself; a helper must listen for orientation and apply the monitor
transform.The natural helper,
iio-hyprland-git(AUR), issueshyprctl keyword monitor ... transform/input:touchdevice:transform. Hyprland 0.56 with the Lua parser rejects that:What worked
pacman -S iio-sensor-proxy+ enable the systemd service (it is a static unit activated on demand).A small helper that listens to
net.hadess.SensorProxyand, on each orientation change, runs:hl.monitorreuses the existing monitor rule and only updatestransform(mode/position/scale are preserved), then schedules a monitor-state refresh.hl.deviceapplies the libinput calibration matrix for the touchscreen (devicetransformmaps toMATRICES[N];-1= unset).Orientation mapping:
normal -> 0,left-up -> 1,bottom-up -> 2,right-up -> 3.Proposal
omarchy installentry or setup flag) that pullsiio-sensor-proxyand installs/enables a rotation helper.hyprctl eval(Luahl.*API), since the existing AUR helper is incompatible.ACCEL_MOUNT_MATRIXvia udev) and a--transformremap for devices whose accelerometer orientation doesn't match the panel.Happy to help with a PR if this is in scope.
All reactions