How to Disable Automatic Screen Rotation in Ubuntu on Laptops and Tablets

Modern 2-in-1 convertible laptops—such as the Lenovo Yoga, HP Envy x360, and Dell XPS 2-in-1—contain built-in accelerometer sensors that detect physical device tilt. While automatic screen rotation is convenient when flipping your laptop into tablet mode to read an e-book, sensitive sensors frequently cause Ubuntu to erratically flip upside down or rotate into portrait mode while working normally on your lap or moving around a desk. Ubuntu provides simple toggles to lock screen orientation permanently.

Why Disable Screen Auto-Rotation?

Locking your desktop orientation eliminates sudden display interruptions during everyday productivity:

  • Lap Stability: Prevents slight shifts in leg angle or couch posture from unexpectedly spinning your desktop sideways.
  • Faulty Accelerometer Sensors: Solves persistent bugs where Linux misidentifies the default zero-degree axis on certain laptop motherboards, causing the desktop to boot upside down.
  • Battery and CPU Conservation: Eliminates continuous sensor polling by the system accelerometer daemon (iio-sensor-proxy).

Method 1: Lock Orientation via Ubuntu Quick Settings (Fastest)

The GNOME desktop environment in Ubuntu features a dedicated orientation lock tile in the system tray:

  1. Ensure your display is currently rotated in your preferred landscape orientation.
  2. Click the Quick Settings menu in the top-right corner of the Ubuntu top bar (the cluster with Wi-Fi, volume, and battery icons).
  3. Look for the Auto-Rotate quick toggle tile (represented by a rotating screen icon).
  4. Click the Auto-Rotate tile to toggle it off. When greyed out or showing a small lock symbol, orientation is securely locked.
  5. Tilt your laptop physically to verify the screen remains firmly anchored in landscape mode.

Method 2: Lock Orientation via Ubuntu Display Settings

If your hardware does not display an orientation tile in Quick Settings, you can set a permanent orientation through the main Settings menu:

  1. Open Settings from your Ubuntu application menu.
  2. Click on Displays in the left-hand sidebar.
  3. Locate the Orientation dropdown menu.
  4. Ensure it is set to Landscape (or Portrait if configuring a vertical secondary coding monitor).
  5. Look for the Automatic Screen Rotation toggle switch directly beneath the orientation setting.
  6. Toggle the switch to the OFF position.
  7. Click Apply in the top-right corner to save your changes.

Method 3: Disable the Sensor Daemon (Permanent Hardware Fix)

If you have an older convertible laptop where sensor bugs persistently flip the display despite GUI toggles, you can disable the background accelerometer sensor service entirely via Terminal:

  1. Press Ctrl + Alt + T to launch Terminal.
  2. Run the following command to stop and disable the sensor service:
    sudo systemctl stop iio-sensor-proxy.service && sudo systemctl disable iio-sensor-proxy.service
  3. Enter your administrator password to confirm. Your display will now behave like a traditional stationary laptop screen permanently.
  4. Note: If you ever want to re-enable auto-rotation in the future, simply run:
    sudo systemctl enable --now iio-sensor-proxy.service

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.