2-in-1s and Tablets
Automatic rotation
On a 2-in-1 laptop or a tablet, hyprmoncfg can turn the built-in panel with the device. It reads the accelerometer through iio-sensor-proxy, so there is no script to write and nothing fights over the rotation:
- The panel turns within a moment of the device settling.
- Monitors beside it move to stay touching, the way they do when you change a display’s resolution.
- The touchscreen and pen turn with the panel.
- Every Hyprland reload keeps the current rotation, because the generated config always holds it.
Your saved profile never changes. It keeps describing the layout with the device upright, and the rotation is applied on top while hyprmoncfgd runs.
Setting it up
-
Install iio-sensor-proxy, which provides the accelerometer:
sudo pacman -S iio-sensor-proxy - Make sure your user can read the tablet-mode switch, so a convertible only
turns when folded into a tablet. Omarchy users are in the
inputgroup already; check withid, and add yourself withsudo usermod -aG input $USERif not. - In the TUI or the Omarchy panel, select the built-in panel and set Rotation to Auto. Save the profile.
- Remove any script of your own that rotates the screen, such as one built on
monitor-sensororiio-hyprland. Two programs rotating the same panel will undo each other.
Auto appears only for a built-in panel, and only when hyprmoncfgd reports an orientation sensor. Restart hyprmoncfgd after installing iio-sensor-proxy.
iio-sensor-proxy only lets the active session claim the sensor, and a daemon
started at login can ask before the login screen has let go of the seat. The
daemon keeps asking, every 2 seconds at first and then up to once a minute, and
hyprmoncfg rotation says it is waiting. Auto starts working without a restart.
Upright
The rotation the panel has when you choose Auto is its upright rotation. For most devices that is Normal. Some tablets have a panel mounted in portrait: set the rotation that looks right with the device upright first, then choose Auto. The inspector then shows, for example, Auto, upright 270°, and the sensor’s turns add to that.
Choosing Auto also takes the device’s current position as upright, as Calibrate does, so the panel keeps the rotation it had. Hold the device the way that rotation looks right when you choose it. Normal back to Auto restores the remembered upright rotation instead and leaves the calibration alone. Without a sensor reading, for example while the device lies flat, or during a preview, the calibration stays as it was.
Leaving Auto remembers that upright rotation. Choosing Normal and then Auto again restores it, because Normal says nothing about which way is up. To replace it, choose the new rotation and then Auto. To make Normal the upright rotation again, choose any other fixed rotation, then Normal, then Auto. To hold a turn for a while, use the lock rather than a fixed rotation.
Calibrate the sensor’s upright position
If Auto adds a quarter turn even though you selected the correct fixed rotation,
hold the device upright relative to its keyboard (or the way you normally use a
tablet), then press Calibrate in the Omarchy panel, press C in the TUI, or
run:
hyprmoncfg rotation calibrate
This records the sensor reading as upright and unlocks rotation. It leaves saved profiles unchanged and persists across daemon restarts. Set the panel’s correct fixed rotation, such as 270°, before choosing Auto. Direction reversal changes which way turns go; calibration changes where they start. Recalibrate after changing the system sensor mount matrix. Calibration requires a current daemon and refuses to run during a preview or while the sensor reports the device flat.
Preview behavior
A preview applies the orientation at its start and holds it while you decide. Auto rotation resumes after Keep, including when keeping a temporary layout without saving a profile. This prevents sensor changes from moving the confirmation controls or racing rollback.
Tablet mode
A convertible with a tablet-mode switch turns its panel only while folded into a tablet, as GNOME does, so a laptop tilted on your lap stays put. Folded back into a laptop, the panel goes upright. A device with no such switch, such as a tablet or a detachable, always follows the sensor. Lying flat keeps the last rotation.
Rotation lock
Lock the rotation to keep the panel as it is, for example to read lying down:
hyprmoncfg rotation lock # hold the current rotation
hyprmoncfg rotation unlock # follow the device again
hyprmoncfg rotation toggle # switch between the two
hyprmoncfg rotation # show the current state
Bind hyprmoncfg rotation toggle to a key for a one-press lock. On Omarchy,
add it to ~/.config/hypr/bindings.lua:
o.bind("SUPER + O", "Rotation lock", "hyprmoncfg rotation toggle")
Elsewhere, bind it the way your config runs any other command.
In the TUI, press L. In the Omarchy panel, use the lock beside Auto. The
lock is remembered across restarts. Unlocking turns the panel to the way the
device is held now.
If it turns the wrong way
If the panel turns the opposite way to the device, reverse the direction:
hyprmoncfg rotation direction reversed
Undo it with hyprmoncfg rotation direction normal. The setting belongs to
the device, not to a profile, and survives restarts. If the panel is the
right way round only when the device is turned, set its upright rotation
instead (see Upright). If the sensor reports a non-normal orientation while you hold the device
upright, calibrate it as described above.
Both come from the device’s accelerometer mount matrix in the system hardware
database, which is missing or wrong for some models, and GNOME and KDE turn
those wrong too. To fix it for every program at once, add an
ACCEL_MOUNT_MATRIX entry for your device to
/etc/udev/hwdb.d/61-sensor-local.hwdb, as the
iio-sensor-proxy documentation
explains, and consider sending it upstream to systemd. Then set the direction
back to normal.
Limits
- Fixed rotations of a connected, enabled built-in panel also keep touch and pen aligned, including after disabling Auto or restarting Hyprland.
- Touch and pen rotation use Hyprland’s global
input:touchdevice:transformandinput:tablet:transform. An external drawing tablet turns with the panel too. - Only built-in panels rotate. External monitors don’t turn with the device.
- Rotation needs hyprmoncfgd. Applying a profile from the TUI or CLI without the daemon uses the upright layout.