Skip to content

omamobile-settings 0.1.3: a Keyboard haptics page - #629

Draft
Somnius wants to merge 4 commits into
derekross:mainfrom
Somnius:settings-haptics-1110
Draft

Somnius wants to merge 4 commits into
derekross:mainfrom
Somnius:settings-haptics-1110

Conversation

@Somnius

@Somnius Somnius commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

@derekross, @marselnenaj, this is the second page for the Settings app, stacked on the Display page in #628: the first commit here is that one, so only the second commit is new. I'll rebase once #628 is in.

It sets the strength of the tick feedbackd plays for key and button presses: Low, Medium or High (0.015, 0.035 and 0.07 for 15 ms), or Off, which switches feedbackd's profile to silent for the whole phone. It edits the two key entries of the user's custom feedbackd theme and nothing else in it. Nothing above 0.125 or longer than 60 ms is ever written, the first version of the theme is kept once as custom.json.bak-haptics, and a theme that doesn't have exactly those two entries is refused before anything changes. The page opens with org.omamobile.Settings.Open("haptics").

The Keyboard haptics page

The page only works where that theme exists, and the theme and the udev rule that tags the motor for feedbackd aren't in any package yet (I wrote about how I set them up on #538). On a phone without the theme the page says so and changes nothing. If you'd rather this wait until the theme ships in the device package, I can leave it as a draft.

Review fixes already in: the script runs python isolated, nothing in the environment changes what runs (the test uses a copy of the script), the theme is replaced atomically with its mode kept and any symlink followed, and a failed write doesn't leave the profile flipped. A level after Off puts the profile back to full, whatever it was before.

Tested on a Pixel 8 Pro: test/all passes on the phone with the new backend test (levels, Off and back, the cap, a theme with a missing entry, mode kept, no theme). I ran the backend live from a session: it read the current level, set another, and I put it back. I didn't check by hand that the tick feels different at each level on this build. Not tested on any other phone, and the Off behaviour for calls and alarms is still the open question from #538.

@derekross

Copy link
Copy Markdown
Owner

@Somnius thank you, the careful parts of this are good: the theme is checked for exactly the two key entries before anything is written, the write is atomic with the mode kept, nothing above 0.125 or 60 ms can be written, and the first version of the file is kept once. It also goes back on Escape like every Settings page must since #643. I replayed the stack onto today's main and its tests pass there.

Three things before it can go in. The first is a bug, the other two are decisions I owe you.

1. On a phone without the theme, "Silent, whole phone" works and nothing can turn it back. set level off runs before any check of the theme, so it sets feedbackd's profile to silent everywhere. The page leaves the buttons enabled after the first read fails, and every other level then stops at "theme file not writable" before it would set the profile back to full. With your dry-run copy and no custom.json:

get                -> {"error":"no keyboard haptics theme on this phone"}
set level off      -> {"level":"off"}                      (profile is now silent)
set level low      -> {"error":"theme file not writable"}  (profile stays silent)

Since no package ships the theme yet, that's every phone but yours. Please refuse Off (and disable the buttons) where the theme is missing, and add that case to the test.

2. silent stops more than vibration. On our phones omatel rings calls and messages through feedbackd, and feedbackd's silent profile drops sound as well as vibration. So the first row of "Keyboard haptics" would stop the phone from ringing until someone comes back to this page, and the row's hint only mentions vibration. You flagged the calls-and-alarms question from #538 yourself, and I hadn't answered it; that's on me. My answer: a keyboard page shouldn't change whether calls ring. Either leave Off out for now, or make it a keyboard-only Off (for instance by removing or zeroing the two key entries, with the check taught to accept that state). A phone-wide silent switch belongs with sound, not here.

3. The row shows on every phone, and only yours has the theme. I'd rather not show a page that opens to an error. Two ways: keep this as a draft until the theme and the udev rule ship in a package (the #538 work), or have the catalog hide the row when your probe verb says unavailable (nothing calls probe yet). Either is fine; tell me which you prefer.

Smaller things: the "Lef 2026-11-08" notes in the script's header would read better as a pointer to #538; the watch verb only runs get; and a README line that changing the level restarts feedbackd (a ring in progress would stop).

Versions: #643 took 0.1.1 today, so #628 becomes 0.1.2 and this one 0.1.3; I'll set them at merge. After #628 is in, rebase with git rebase --onto origin/main 6a2fb993e0 settings-haptics-1110.

@Somnius
Somnius force-pushed the settings-haptics-1110 branch from d46bd91 to 5dda1cc Compare November 13, 2026 18:30
@Somnius Somnius changed the title omamobile-settings 0.1.2: a Keyboard haptics page omamobile-settings 0.1.3: a Keyboard haptics page Nov 13, 2026
@Somnius
Somnius marked this pull request as draft November 13, 2026 18:30
@Somnius

Somnius commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

@derekross, thank you. All three are done, and the branch is rebased with your command, so it is on top of main now and the version is 0.1.3.

  1. Without the theme: the page reads the theme first and draws no level buttons until it has, so a phone without one gets only the message. set refuses before it changes anything when the theme is missing ("no keyboard haptics theme on this phone"), has one key entry, or isn't JSON, and get and probe now apply the same exactly-two-entries rule as set, so a theme that set would refuse never gets live buttons. The test covers get, probe and set on a missing, a one-entry and a broken theme, and that nothing is created when there is no theme.
  2. Off is gone. Nothing in the backend touches feedbackd's profile or gsettings any more (the profile helpers and the watch verb are removed), and the page hint, the catalog row and the PKGBUILD no longer say silent.
  3. I'm keeping it as a draft until the theme and the udev rule ship in a package (the Pixel 8 Pro: keyboard haptics through feedbackd, a tick on the lock screen's PIN pad, and what I found in fbcli #538 work), rather than hiding the row with probe, which would need a change in the catalog.

The smaller things: the header points to #538 instead of dated notes, the README says that changing the level restarts feedbackd, and there's a core test that goes to the page and back to the root. Two failure paths of set printed no JSON or two lines; they print one now.

What ran: the haptics and display backend tests locally, and on GitHub both checks pass on this head (5dda1cc): Policy, and Tests (tests/all, every package), which includes the Settings tests. I did not run test/all on my own phone for this head, because the phone is off.

@Somnius

Somnius commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Here's the page running on my Pixel 8 Pro, at Medium. It stays a draft until the theme and udev rule ship with #538, as agreed.

@marselnenaj, this one and #630 (Change PIN) and #860 (Battery charge limit) are pages on top of the Settings app you started in #526. It's a great app to build on, so if you see anything that doesn't fit how you meant it to grow, tell me.

Keyboard haptics page

Somnius added a commit to Somnius/omarchy-mobile that referenced this pull request Nov 18, 2026
…77759-charger

The page runs backends/charge.sh like the Display page does. Setting a value
runs systemctl start --no-ask-password omamobile-charge-limit@N.service (a
polkit rule allows those five instances for the active local user), which runs
libexec/charge-limit as root: start threshold 0 (resume 5 below), then the end
threshold, and only then /etc/omamobile/charge-limit is saved. No writable end
threshold or a failed write: exit 1, nothing saved.

At boot a udev rule on the charger's add pulls in
omamobile-charge-limit-apply.service, which applies the saved value on husky
only (device tree google,zuma-husky). Units have StartLimitIntervalSec=0.

Note: the page is inert on husky today. omamobile-device-husky blacklists
max77759_charger, so there is no max77759-charger power supply and the page
says the limit is not available until that blacklist is lifted.

Version 0.1.3 (to be renumbered at merge; derekross#629 and derekross#630 hold 0.1.3/0.1.4).
Tests: test/charge-backend.sh against a scratch root (backend, helper, a
stand-in systemctl, polkit/unit/udev contents, staged paths and modes), core
tests open BatteryPage and check the runner's charge entry.
@derekross

Copy link
Copy Markdown
Owner

Thanks, Lef. All three points from last time are answered in the code as you describe: set refuses before it changes anything when the theme is missing or isn't the two-entry shape, the buttons only appear after a level has been read, and nothing touches feedbackd's profile any more. Keeping it a draft until the theme and the udev rule ship is the right call, and I have nothing unsafe to report.

Before it leaves draft:

One thought, not a condition: changing the level stops feedbackd, and on our phones that is also what rings a call. Refusing the change while a call is ringing would avoid a silenced ring.

I did not run the tests or the page this round; CI is green on this head.

Somnius added a commit to Somnius/omarchy-mobile that referenced this pull request Nov 18, 2026
…77759-charger

The page runs backends/charge.sh like the Display page does. Setting a value
runs systemctl start --no-ask-password omamobile-charge-limit@N.service (a
polkit rule allows those five instances for the active local user), which runs
libexec/charge-limit as root: start threshold 0 (resume 5 below), then the end
threshold, and only then /etc/omamobile/charge-limit is saved. No writable end
threshold or a failed write: exit 1, nothing saved.

At boot a udev rule on the charger's add pulls in
omamobile-charge-limit-apply.service, which applies the saved value on husky
only (device tree google,zuma-husky). Units have StartLimitIntervalSec=0.

Note: the page is inert on husky today. omamobile-device-husky blacklists
max77759_charger, so there is no max77759-charger power supply and the page
says the limit is not available until that blacklist is lifted.

Version 0.1.3 (to be renumbered at merge; derekross#629 and derekross#630 hold 0.1.3/0.1.4).
Tests: test/charge-backend.sh against a scratch root (backend, helper, a
stand-in systemctl, polkit/unit/udev contents, staged paths and modes), core
tests open BatteryPage and check the runner's charge entry.
Somnius added a commit to Somnius/omarchy-mobile that referenced this pull request Nov 18, 2026
… keyboard

The Display page gets 30 s, 1, 2, 3, 5 min and Never, plus an on/off for
staying unlocked while a keyboard is connected. The text says that lock and
screen off are the same timer and that Never also keeps the phone awake.
0.1.3 clashes with open derekross#629, derekross#630 and derekross#860; renumber at merge.
The strength of the tick feedbackd plays for key and button presses, in
three levels (0.015, 0.035 and 0.07 for 15 ms, nothing above 0.125 or 60 ms
is ever written), or Off, which switches feedbackd's profile to silent for
the whole phone. It edits the two key entries of the user's custom feedbackd
theme (a .bak-haptics copy is kept once), restarts feedbackd by exact name
and plays one tick. A phone without that theme gets a plain message on the
page.

Stacked on the Display page (the ActionRunner and the catalog are from
there). The theme and the udev rule that tags the motor are not in a
package yet; the page needs them.

Signed-off-by: Lef <me@lefteros.com>
…tons without the theme

Off is gone: feedbackd's silent profile drops sound as well as vibration, so a
keyboard page must not set it, and nothing in the backend touches feedbackd's
profile now (the profile helpers and the watch verb are removed). Where the
theme is missing the page reads the error and leaves the three level buttons
off, and set refuses before anything changes (test). The header points to the
keyboard haptics notes in derekross#538 instead of dated notes, the README says that a
level change restarts feedbackd, and a core test goes to the page and back.
…ne rule for get and set

The three buttons are not drawn until the theme has been read, a theme that
does not have exactly the two key entries is refused by get and probe as well
as by set, a missing theme is named as missing, and every failure path of set
prints one JSON line. The catalog row and the PKGBUILD no longer mention the
silent profile, the header says which environment is read, and the test also
covers get and probe on a one-entry, a broken and a missing theme and that
nothing is created without a theme.
Signed-off-by: Lef <me@lefteros.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants