Skip to content

omamobile-shell 0.2.67: omamobile-setup-user --adopt, for a user set up by hand - #259

Closed
W4HO-ham wants to merge 2 commits into
derekross:mainfrom
W4HO-ham:shell-setup-adopt
Closed

W4HO-ham wants to merge 2 commits into
derekross:mainfrom
W4HO-ham:shell-setup-adopt

Conversation

@W4HO-ham

@W4HO-ham W4HO-ham commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

As agreed on #243: omamobile-setup-user --adopt, for a user set up by hand rather than by firstboot.

The problem. Such a user has none of the setup's once-only markers, so omamobile-setup-user.service is skipped at every login: its condition is the omamobile-shell-profile marker. Running the script by hand would copy the package's shell.json over the user's and repeat every other once-only step, appending the cursor and keyboard lines to the Hyprland files again and reseeding the scale.

The change. With --adopt, omarchy-done ensure becomes a check-and-mark: each once-only step is marked done and not run, and the script prints what it adopted. The parts that run at every login still run: the plugin links, the keyboard layouts and theme, and the menu entries kept current. A step the user does want can be had later by removing its marker before a login. The README row says so.

Tests. A new case in test/setup-user.sh builds a hand-set-up home with no markers, its own shell.json and a looknfeel with a cursor line. --adopt leaves those files byte-identical, marks the once-only steps, links the plugins and reports what it marked, and a normal login run afterwards changes nothing. The test's fake omarchy-done learned check. test/all passes.

On the palmtop (the user from #243, set up during bring-up, omamobile-shell 0.2.62 installed, this script run from /tmp): first a backup of the user's config to /root. Then --adopt marked 46 steps, and shell.json, the Hyprland files and foot.ini hashed the same before and after. With the profile marker in place, systemctl --user start omamobile-setup-user then ran for the first time on that phone ("inactive (dead) since …", no longer "condition unmet"). The user's files were still unchanged, and all 12 plugin links point at the package.

Version 0.2.67: main is at 0.2.64, and #217 and #124 are waiting on 0.2.65 and 0.2.66, so set whatever is free at merge. tools/pr-check passes.

…up by hand

A user set up during bring-up has none of the setup's once-only markers, so the login service never runs, and running the script would reseed shell.json and repeat every step. --adopt marks each once-only step done without running it; the per-login parts still run.
… repeat

The first version marked every once-only step, so a hand-set-up user also lost the steps that check their files first, such as Chromium's no-first-run and mobile flags: on the palmtop Chromium opened on its terms-of-service page. Only the shell profile, the monitor scale, the appended cursor and keyboard lines and the screensaver files are skipped now.
@W4HO-ham

W4HO-ham commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

A correction from real use. The first --adopt marked every once-only step, so the palmtop also lost the steps that check the user's files before they change anything. On the walk today Chromium opened on its "Additional Terms of Service" page, because --no-first-run, the mobile user agent, the scale factor and the Wayland IME flags were never written.

--adopt now marks only the steps that would overwrite or repeat what a hand-set-up user has: omamobile-shell-profile, omamobile-monitor-scale, omamobile-hide-cursor, omamobile-osk and omamobile-screensaver. Every other step runs as on a new user, since each checks first (Chromium's flags, the menu entries, the plugins, foot-touch only over Omarchy's values, phone-rules only if no phone.lua is loaded).

The test now builds a user who owns each of those files and checks that --adopt leaves them alone, that Chromium's flags are written, and that a login afterwards changes nothing. I'll run it on the palmtop again and post the result here.

@derekross

Copy link
Copy Markdown
Owner

Thanks, and good catch on Chromium. Marking only the steps that would overwrite or repeat something is the right fix, and the new test covers exactly that case. I ran test/setup-user.sh merged onto today's main and it passes. Without --adopt nothing changes, since the wrapper is only defined when the flag is given.

A few notes, none of them a big change:

  • The README row still describes the first version ("marks every once-only step done"). I'll reword it at merge to say which steps are marked and that the rest run as for a new user, and I'll write the squash message from your second commit so the first one's wording doesn't land.
  • What the other steps change for an adopted user, so we both expect the same result: the plugin steps add the phone plugins the user's shell.json doesn't list yet (all eight in your test home). The idle step adds the phone's idle block (lock after 60 s, no screensaver) if shell.json has none. The Chromium steps replace a user agent or scale factor of the user's own. The suspend-off, lock-keypad and lock-after-screensaver toggles get set. That's what a new user gets, so I think it's right, but the script's comment says the other steps "check first", and those few don't. Worth a look on the palmtop's shell.json in particular.
  • The palmtop re-run of this version that you mentioned: please post it here (what --adopt reported, the files before and after, uname -r and the omamobile-shell version). Then I'll merge.

The version conflicts with main (now 0.2.66). Leave it: I'll set the next free number at merge, in the title too.

@W4HO-ham

W4HO-ham commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

The palmtop re-run, today: 7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty, omamobile-shell 0.2.68-1 installed, and bin/omamobile-setup-user from this branch's head (367f89b) run as the session user with --adopt.

It printed nothing and exited 0. shell.json, chromium-flags.conf, the done markers and the toggles directory were the same before and after (diff -r of the copies: no changes). That's because this version had already run on the palmtop at 12:19 today. That run set up Chromium (--no-first-run, the mobile user agent, --force-device-scale-factor=0.83, which is the fix you reviewed), and its output wasn't kept. All five once-only markers it adopts (omamobile-shell-profile, -monitor-scale, -hide-cursor, -osk, -screensaver) were already there, so this run had nothing to mark. The first version's run on 10-31 is the one that marked omamobile-idle, -lock-after-screensaver, -menu-update and -menu-voice as well.

On what the other steps change, I looked at the palmtop's shell.json as you suggested:

  • Plugins: it lists all eleven phone plugins, the eight in your test home included, so the plugin steps add nothing here.
  • Idle: the block is the user's own (screensaver and lock at 86400 s), and the step left it alone, as you describe.
  • Toggles: suspend-off, lock-keypad, lock-after-screensaver and lock-on-start are set.
  • Chromium: the flags are the setup's.

So on this palmtop the run matches what a new user gets. You're right that "check first" in the script's comment overstates it for those few steps. I'll leave the rewording to your merge along with the README row, unless you'd rather I push it.

@derekross derekross closed this in 3a247cb Nov 1, 2026
derekross pushed a commit that referenced this pull request Nov 1, 2026
Files opens folders with a single tap. omamobile-setup-user sets
org.gnome.nautilus.preferences click-policy to single once, behind its
own omamobile-files-single-tap marker, so someone who goes back to
double-click keeps that. It first checks that the key exists (gsettings
list-keys) and does nothing, and sets no marker, if it doesn't.
test/setup-user.sh covers both cases. Checked on the Pixel 8 Pro: Nautilus
51.1 has the key with the range 'single' 'double'.

Maintainer edits at merge: the test file's conflict with #259 resolved
(both cases kept), and the key probe uses grep -c under pipefail.

Closes #271

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derekross

derekross commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Landed on main as 3a247cb (squashed, authored by you). My review notes from before the merge, for the record:

Thanks for the re-run, and for being upfront that it had nothing left to mark because the 12:19 run had already done the work. That's fine: that earlier run is the one that wrote Chromium's flags, so it shows what this version does. Your read of the palmtop's shell.json (all eleven plugins already listed, your own idle block left alone, the toggles set, Chromium's flags from the setup) answers my question about the other steps.

I'll merge it now. At merge I'll reword the README row and the script's comment as we discussed, so they say which steps are marked and which of the others change what's there. I'll also write the squash message from your second commit and set the version, which stays 0.2.67.

robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…up by hand (derekross#259)

`omamobile-setup-user --adopt` is for a user set up by hand rather than by
firstboot. It marks done, without running them, only the once-only steps
that would overwrite or repeat what that user already has: the shell
profile, the monitor scale, the appended cursor and keyboard lines and
the screensaver files. The other steps run as for a new user: missing
phone plugins and an idle block go into shell.json, the suspend and lock
toggles are set, and Chromium's flags are written. After that the setup
service can run at each login. Without --adopt nothing changes. Tested
on the palmtop; test/setup-user.sh covers the adopted case.

Closes derekross#259

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…oss#271)

Files opens folders with a single tap. omamobile-setup-user sets
org.gnome.nautilus.preferences click-policy to single once, behind its
own omamobile-files-single-tap marker, so someone who goes back to
double-click keeps that. It first checks that the key exists (gsettings
list-keys) and does nothing, and sets no marker, if it doesn't.
test/setup-user.sh covers both cases. Checked on the Pixel 8 Pro: Nautilus
51.1 has the key with the range 'single' 'double'.

Maintainer edits at merge: the test file's conflict with derekross#259 resolved
(both cases kept), and the key probe uses grep -c under pipefail.

Closes derekross#271

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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