Skip to content

omamobile-shell 0.2.128: the phone's file chooser and permission sheet survive Omarchy's Secret-portal migration - #727

Open
den-kloot wants to merge 1 commit into
derekross:mainfrom
den-kloot:portal-user-config
Open

den-kloot wants to merge 1 commit into
derekross:mainfrom
den-kloot:portal-user-config

Conversation

@den-kloot

Copy link
Copy Markdown
Contributor

Omarchy's migration 1788261467.sh ("Expose GNOME Keyring to sandboxed apps through the Secret portal", omarchy-settings 4.5) writes ~/.config/xdg-desktop-portal/hyprland-portals.conf containing default=hyprland;gtk and the Secret line. xdg-desktop-portal reads the user's file first, so after that migration the phone's picks in /etc/xdg/xdg-desktop-portal/hyprland-portals.conf stop applying:

  • FileChooser=gnome;gtk: file dialogs are GTK 3's desktop chooser again. It needs 623 px, and the Pixel 9a has 405 px, so Hyprland squeezes its buffer to fit the screen and the text is drawn tall and narrow.
  • Access=omamobile;gtk: the permission question goes back to GTK's dialog.

Here it showed up in the WhatsApp web app, under Attach › Photos & videos. On this phone the migration ran with omamobile-update on 2026-11-12.

Change: at each login, omamobile-setup-user copies every line from the /etc file whose interface the user's file doesn't name yet. The added lines go under a comment. xdg-desktop-portal is restarted only when a line was added.

  • If there is no user file, nothing is created.
  • A line the user set themselves (e.g. FileChooser=gtk) is kept.
  • It runs at every login, not once, because the migration can arrive with any later update.

Tests: test/setup-user.sh passes on the phone. The new case starts from Omarchy's file and runs two logins. It checks that both lines are added once, that the Secret line stays, and that the portal restarts once. It also checks that a user's own FileChooser line is kept and that no file is created where there was none. I haven't run test/all.

On a Pixel 9a (omamobile-shell 0.2.127, omarchy-settings 4.5.0-3):

  • With Omarchy's file in place, a portal OpenFile call opened xdg-desktop-portal-gtk.
  • After the new step ran, the file had the two extra lines and the same call opened Nautilus (org.gnome.Nautilus) full screen.
  • In WhatsApp, Attach › Photos & videos picked a file through Nautilus.
Before (GTK 3 chooser, squeezed) After (Nautilus)

The version is 0.2.128, which #555 also uses. Renumber as needed.

Found with an AI assistant (Claude), tested on my phone.

🤖 Generated with Claude Code

…t survive Omarchy's Secret-portal migration

Omarchy's migration 1788261467 ("Expose GNOME Keyring to sandboxed apps
through the Secret portal") writes ~/.config/xdg-desktop-portal/
hyprland-portals.conf with default=hyprland;gtk and the Secret line.
xdg-desktop-portal takes the user's file first, so after that migration
the phone's picks in /etc/xdg/xdg-desktop-portal/hyprland-portals.conf
(FileChooser=gnome;gtk, Access=omamobile;gtk) no longer applied: file
dialogs were GTK 3's desktop chooser again. It needs 623 px; on the
Pixel 9a's 405 px Hyprland squeezed its buffer to the screen, text drawn
tall and narrow (WhatsApp web app, Attach > Photos & videos).

omamobile-setup-user now adds, at each login, every line of the /etc file
whose interface the user's file doesn't name yet, under a comment, and
restarts xdg-desktop-portal only when it added one. No user file: nothing
is made. A line the user set (FileChooser=gtk) stays. Every login, not
once, since the migration can arrive with any later update.

test/setup-user.sh: Omarchy's file, two logins: both lines added once,
Secret kept, one portal restart; a user's own FileChooser line kept; no
file made where there was none.

On a Pixel 9a (omamobile-shell 0.2.127, omarchy-settings 4.5.0-3): with
Omarchy's file in place a portal OpenFile opened xdg-desktop-portal-gtk;
after the new step the file gained the two lines and the same call
opened Nautilus (org.gnome.Nautilus), full screen; WhatsApp's Attach >
Photos & videos picked a file through it.

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

Copy link
Copy Markdown
Owner

Thank you for this, and for tracking it down to the migration rather than to the chooser. I checked it against Omarchy 4.5.0-3's own packages: the migration writes exactly the file you describe, and omarchy-settings also puts the same file in /etc/skel, so every user made on a 4.5 image starts with it. That makes your fix more important than the description says: it is on fresh installs too, and very likely on my Pixel 7 Pro.

The change reads well: only the interfaces the user's file doesn't name, the user's own line kept, nothing created where there is no file, the portal restarted only when something was added, and a test that checks each of those. I ran the new step on its own against a few files in a scratch folder and it behaved as described, including a file without a final newline.

A few small things, none of them blocking, if you'd like to take them in the same push:

  1. If ~/.config/xdg-desktop-portal/hyprland-portals.conf is a symlink (Omarchy's migration checks for one, so dotfile setups exist), the echo >> either writes into the linked file or, if that is read-only, fails, and with set -e the setup unit then fails at every login. Skipping a symlinked or unwritable file, with a line in the output, would avoid both.
  2. grep -q "^${line%%=*}=" misses a user's line written with spaces around = (FileChooser = gtk), and the phone's line is then added after it as a duplicate. Allowing blanks around the = (and escaping the dots, which are wildcards in the pattern now) would keep the user's choice in that case too.
  3. The lines go at the end of the file, which is right while the file has only [preferred]. If you'd like it to be explicit, check that the last group is [preferred], or skip otherwise.
  4. Could you paste a tools/phone-smoke report from the 9a with this build? CONTRIBUTING asks for one with a package change.

On the version: #555 also uses 0.2.128, as you noted. I'll set the number when I merge, so please leave it as it is.

Before merging I'll run it on my Pixel 7 Pro: read the user's portal file, install this build, log in again, and open a file chooser and a permission request. I'll report here.

derekross added a commit that referenced this pull request Nov 14, 2026
…ys suspend is verified (#737)

* omamobile-shell 0.2.129: auto-sleep on by default where the device says suspend is verified

omamobile-sleepd (s2idle 30 s after the screen goes off behind a secure
lock) shipped off on every phone. On the Pixel 7 Pro it is now verified:
a night asleep with about 22 h of standby, power off, and double tap
waking the phone from sleep (SUSPEND-PLAN, 2026-11-13). Turn the toggle on
once, at login, on a phone whose device package installs
/usr/share/omamobile/auto-sleep-default; every other phone keeps it off,
and a user who turns it off keeps it off. With the modem up the phone
still doesn't sleep (its inhibitor stays until linux-omarchy-mobile#232).

0.2.128 is claimed by #555 and #727.

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

* omamobile-shell: the default-off test allows only the device-gated auto-sleep step

The package test refused any code that turns the omamobile-sleep toggle
on. #737 adds exactly one such step, gated on the device package's
auto-sleep-default. The test now allows that one line and checks that the
gate sits right above it; anything else that turns the toggle on still
fails.

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

---------

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