Skip to content

Commit dfa9cea

Browse files
authored
Merge pull request #52 from FrameworkComputer/framework12-accel-ubuntu25.04-workaround
framework12: Simplify accel workaround on 25.05
2 parents 7c93d91 + 21f72c7 commit dfa9cea

File tree

3 files changed

+10
-331
lines changed

3 files changed

+10
-331
lines changed
Lines changed: 10 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,22 @@
11
# Ubuntu 25.04 Tablet Mode Setup
22

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.
44

55
> 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.
66
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, ...).
88

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_:
239
```
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
2513
```
2614

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-
![Running Script](https://raw.githubusercontent.com/FrameworkComputer/linux-docs/refs/heads/main/framework12/images/install.png)
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:
7516

7617
```
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)
7822
```
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.

framework12/scripts/Framework-12-Ubuntu-25-04-tablet-mode.sh

Lines changed: 0 additions & 185 deletions
This file was deleted.

framework12/scripts/Un-do-tablet-customizations.sh

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)