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.
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.
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). Together the two cover every way a sensor
can be mounted.
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
- 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.