|
1 | 1 | # Ubuntu 25.04 Tablet Mode Setup
|
2 | 2 |
|
3 |
| -This script will set up tablet mode support for your laptop on Ubuntu 25.04, giving you an experience similar to what Fedora 42 and Bazzite offer out of the box. |
| 3 | +This guide will help set up screen rotation support for your laptop on Ubuntu 25.04, giving you an experience similar to what Fedora 42 and Bazzite offer out of the box. |
4 | 4 |
|
5 | 5 | > Rather not deal with this at all? [Bazzite](https://guides.frame.work/Guide/Bazzite+Installation+on+the+Framework+Laptop+12/409?lang=en) and [Fedora](https://guides.frame.work/Guide/Fedora+42+Installation+on+the+Framework+Laptop+12/410?lang=en) are ready to go out of the box, zero configuration.
|
6 | 6 |
|
7 |
| -What This Script Does |
| 7 | +Ubuntu 25.05 currently ships with iio-sensor-proxy 3.7 that has [a bug](https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/issues/411) preventing it from delivering accelerometer events from kernel to userspace (GNOME, KDE, ...). |
8 | 8 |
|
9 |
| -- Installs necessary packages for tablet mode detection |
10 |
| -- Sets up automatic screen rotation |
11 |
| - |
12 |
| -### Need to revert these changes back to Ubuntu defaults to test if Ubuntu updates have corrected failure to rotate the screen? |
13 |
| -- [Revert to Ubuntu iio-sensor-proxy defaults with Ubuntu's latest version](#revert-to-ubuntus-defaults-for-testing-any-potencial-solutions-from-ubuntu-updates). |
14 |
| - |
15 |
| -## To setup tablet mode compatibility for Ubuntu 25.04 (ONLY): |
16 |
| - |
17 |
| -Install Curl, copy, paste into a terminal, enter key: |
18 |
| -``` |
19 |
| -sudo apt install curl -y |
20 |
| -``` |
21 |
| - |
22 |
| -Copy, paste code below into a terminal, enter key - reboot when prompted at the end - _one and done_: |
23 | 9 | ```
|
24 |
| -curl -s https://raw.githubusercontent.com/FrameworkComputer/linux-docs/refs/heads/main/framework12/scripts/Framework-12-Ubuntu-25-04-tablet-mode.sh -o Framework-12-Ubuntu-25-04-tablet-mode.sh && clear && sudo bash Framework-12-Ubuntu-25-04-tablet-mode.sh |
| 10 | +sudo sed 's/.*iio-buffer-accel/#&/' -i /usr/lib/udev/rules.d/80-iio-sensor-proxy.rules |
| 11 | +sudo udevadm trigger |
| 12 | +sudo systemctl restart iio-sensor-proxy |
25 | 13 | ```
|
26 | 14 |
|
27 |
| -> IMPORTANT: When rebooting, log back in. Wait about 20 second until the desktop loads, it will flash for a second then all is well. This is the extension installing itself and activating. Do not rush this. |
28 |
| -
|
29 |
| - |
30 |
| -Running the script in the future After the install, you can run going forward with the following in the HOME directory. So merely opening a terminal and running this will work if the original script has not been moved - remember to reboot when prompted at the end. |
31 |
| - |
32 |
| -``` |
33 |
| -sudo bash Framework-12-Ubuntu-25-04-tablet-mode.sh |
34 |
| -``` |
35 |
| - |
36 |
| - |
37 |
| -> IMPORTANT: When rebooting, log back in. Wait about 20 second until the desktop loads, it will flash for a second then all is well. This is the extension installing itself and activating. Do not rush this. |
38 |
| -
|
39 |
| - |
40 |
| - |
41 |
| - |
42 |
| - |
43 |
| -------------------------- |
44 |
| - |
45 |
| -## What does this do and why is it using an extension? |
46 |
| - |
47 |
| -### What This Script Does |
48 |
| - |
49 |
| -This script configures auto-rotation and on-screen keyboard functionality for the Framework Laptop 12 running Ubuntu. Here's what it accomplishes: |
50 |
| - |
51 |
| -- Sets up an UPDATED iio-sensor-proxy service - Installs and configures the sensor proxy service that detects device orientation changes |
52 |
| -- Installs required packages - Adds necessary dependencies for sensor detection and screen rotation |
53 |
| -- Installs Fedora's iio-sensor-proxy package - Uses a version known to work well with the Framework hardware |
54 |
| -- Sets up proper device access for sensor hardware |
55 |
| -- Configures udev rules - Creates rules to ensure sensors have the right permissions |
56 |
| -- Sets up systemd service - Ensures sensor proxy runs automatically at startup |
57 |
| -- Installs screen-rotation extension - Adds the GNOME extension that performs the actual rotation |
58 |
| - |
59 |
| -### Why It Uses a GNOME Extension |
60 |
| - |
61 |
| -The script uses a GNOME Shell extension (screen-rotate(at)shyzus.github.io) for several important reasons: |
62 |
| - |
63 |
| -- Integration with GNOME Desktop Environment - The extension hooks into GNOME Shell's display management system to handle rotation properly |
64 |
| -- User Interface Integration - The extension provides visual feedback during rotation and handles the UI transform smoothly |
65 |
| -- Event Handling - It properly processes sensor events from iio-sensor-proxy and applies the appropriate screen transformations |
66 |
| -- We will fork it and maintain it if needed in the future |
67 |
| - |
68 |
| -The extension serves as the crucial interface layer between the low-level sensor drivers (iio-sensor-proxy) and the user-facing desktop environment, allowing the Framework Laptop 12 to function properly as a convertible device with automatic screen rotation when switching between laptop and tablet modes on Ubuntu 25.04. |
69 |
| - |
70 |
| ---------------------------- |
71 |
| - |
72 |
| -# Revert to Ubuntu's defaults for testing any potencial solutions from Ubuntu updates |
73 |
| - |
74 |
| -If you need to roll back all of the auto-rotation and on-screen keyboard customizations and return to Ubuntu’s vanilla `iio-sensor-proxy`, follow these steps or save the script below as `undo-tablet-mode.sh` and run it under `sudo`. |
| 15 | +Then you can check if screen rotation works: |
75 | 16 |
|
76 | 17 | ```
|
77 |
| -curl -s https://raw.githubusercontent.com/FrameworkComputer/linux-docs/refs/heads/main/framework12/scripts/Un-do-tablet-customizations.sh -o Un-do-tablet-customizations.sh && clear && sudo bash Un-do-tablet-customizations.sh |
| 18 | +> monitor-sensor --accel |
| 19 | + Waiting for iio-sensor-proxy to appear |
| 20 | ++++ iio-sensor-proxy appeared |
| 21 | +=== Has accelerometer (orientation: normal) |
78 | 22 | ```
|
79 |
| - |
80 |
| -What the Undo Script Does |
81 |
| - |
82 |
| -This helper script reverses every customization applied by the tablet-mode installer, restoring Ubuntu’s original auto‐rotation setup. |
83 |
| - |
84 |
| -- Unpins the sensor proxy package: Removes any apt-mark hold on iio-sensor-proxy so Ubuntu upgrades can manage it normally again. |
85 |
| - |
86 |
| -- Removes the Fedora/Koji fallback: Purges the alien-converted RPM build of iio-sensor-proxy and reinstalls Ubuntu’s stock version from the official repositories. |
87 |
| - |
88 |
| -- Deletes the custom systemd service: Disables and removes /etc/systemd/system/Framework-sensor-proxy.service, then reloads systemd so only Ubuntu’s default service remains. |
89 |
| - |
90 |
| -- Deletes the custom udev rule: Removes /etc/udev/rules.d/61-sensor-local.rules and triggers udev to reload, restoring default device-node permissions. |
91 |
| - |
92 |
| -- Uninstalls the GNOME screen-rotate extension: Deletes the extension directory under the user’s home (~/.local/share/gnome-shell/extensions/screen-rotate@…) and its autostart desktop file, so GNOME returns to its out-of-the-box state. |
93 |
| - |
94 |
| -- Removes the user from the plugdev group: Optionally removes the user from plugdev if they were added, undoing any group-based permission grants. |
95 |
| - |
96 |
| -- Reloads system daemons: Runs systemctl daemon-reload and udevadm trigger to apply all removals immediately, without requiring manual cleanup or a package-level reboot. |
97 |
| - |
98 |
| -After running the script and **rebooting**, your laptop will be running **Ubuntu’s unmodified iio-sensor-proxy and default tablet-mode behavior** - this is useful for testing whether upstream updates have addressed the rotation issue. |
0 commit comments