Repository navigation
omamobile-gnss 0.2.6, omamobile-shell 0.2.86: one GeoClue agent, and weather works with Location on - #359
Merged
Conversation
…er from geoclue's autostart
geoclue 2.8.2 ships /etc/xdg/autostart/geoclue-demo-agent.desktop, so on a fresh release install (7 Pro, 2026-11-02) the session's XDG autostart ran GeoClue's demo agent at every login, Location on or off. Turning Location on then started omamobile-geoclue-agent.service, whose agent found the first one ("Another instance of GeoClue DemoAgent is running"), exited 0 and left the unit inactive; anything that took our unit as the sign of a usable GeoClue (omamobile-weather) thought Location was off. It also meant an agent was registered with Location off.
The package now masks the unit systemd-xdg-autostart-generator makes of geoclue's file, app-geoclue\x2ddemo\x2dagent@autostart.service, with a /dev/null link in /usr/lib/systemd/user: that directory comes before the generator's generator.late in the user unit path, so the mask wins, and geoclue's own file is untouched and keeps its upgrades. Our unit also stops that autostart unit before it starts (ExecStartPre, failure ignored), for a session that started it before the mask existed. The test checks the generator's escaped name against the real generator when it is installed, the mask in the stage, and the doubled backslash systemd's C escapes need in ExecStartPre; these run in CI too, before the prebuilt-only checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BeEcdVeSfyLCbijF8XQF1d
…s, so Location on gives a place On a fresh release install (7 Pro, 2026-11-02) geoclue's XDG autostart ran GeoClue's demo agent, omamobile-gnss's agent unit exited as a second instance, and omamobile-weather's geoclue_usable(), which wanted that unit active, logged "no place (Location off, ...): nothing fetched": the weather widget and the lock screen had no weather although Location was on and GeoClue answered. GeoClue needs an agent registered for the caller's user, not our unit in particular, so geoclue_usable() now takes omamobile-gnss's unit active or any process of this user's running /usr/lib/geoclue-2.0/demos/agent (read from /proc). The Location switch still decides: with omamobile-gnss installed and its switch off (omamobile-gnss-nmea.socket not enabled), GeoClue isn't asked, whatever agent runs, as before. Without omamobile-gnss the agent alone decides. omamobile-gnss 0.2.6 masks the autostart agent, so on a current phone our unit is the agent again; this keeps weather working with either. The quick-settings Location tile needs no change: it reads omamobile-gnss status (the socket's enabled state, the receiver, the vendor files), never the agent, so it showed On correctly in this case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BeEcdVeSfyLCbijF8XQF1d
This was referenced Nov 2, 2026
robertzas
pushed a commit
to robertzas/omarchy-mobile
that referenced
this pull request
Nov 14, 2026
…weather works with Location on (derekross#359) On a fresh install geoclue's own autostart agent (app-geoclue\x2ddemo\x2dagent@autostart.service, from geoclue's XDG autostart file) ran at login, so omamobile-geoclue-agent.service exited ('Another instance of GeoClue DemoAgent is running') and omamobile-weather, which counted Location as on only while that unit ran, fetched nothing. omamobile-gnss now masks the generated autostart unit (a package-owned /dev/null link in /usr/lib/systemd/user; geoclue's files untouched) and its agent unit stops a leftover autostart agent first; omamobile-weather accepts our unit or any of the user's demos/agent processes, still gated by the Location switch. Location off means no agent; on means exactly one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BeEcdVeSfyLCbijF8XQF1d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
On a fresh release install (7 Pro, 2026-11-02) the weather widget and the lock screen showed no weather although Location was on and GeoClue worked. geoclue 2.8.2 ships
/etc/xdg/autostart/geoclue-demo-agent.desktop, so the session's XDG autostart (systemd-xdg-autostart-generator, which uwsm uses throughxdg-desktop-autostart.target) ran GeoClue's demo agent at every login, Location on or off. Turning Location on startedomamobile-geoclue-agent.service, whose agent found the first one ("Another instance of GeoClue DemoAgent is running"), exited 0 and left the unit inactive.omamobile-weather'sgeoclue_usable()wanted that unit active, so it logged "no place (Location off, ...): nothing fetched".omamobile-gnss 0.2.6
app-geoclue\x2ddemo\x2dagent@autostart.service(the generator escapes dashes; checked against the real generator), with a/dev/nulllink in/usr/lib/systemd/user. That directory comes beforegenerator.latein the user unit path, so the mask wins. geoclue's own file isn't touched, so the fix survives geoclue upgrades. Our unit is the only agent again, and Location off once more means no agent is registered.omamobile-geoclue-agent.servicestops that autostart unit first (ExecStartPre=-…systemctl --user stop, failure ignored). This covers a session that started the autostart agent before the upgrade. The backslashes are doubled for systemd's C escapes.omamobile-shell 0.2.86
geoclue_usable()accepts any GeoClue agent registered for this user: our unit active, or a process of this user's running/usr/lib/geoclue-2.0/demos/agent(from/proc). The Location switch still decides: when omamobile-gnss is installed andomamobile-gnss-nmea.socketisn't enabled, GeoClue isn't asked, whatever agent runs. That matches the old behaviour, where our unit only ran with Location on.omamobile-gnss status --json(socket, receiver, vendor files), never the agent, so it showed On correctly in this case.Checks
packages/omamobile-gnss/test/allpasses, with and without the bionic prebuilts.packages/omamobile-shell/test/all,tests/allandtools/pr-check origin/mainpass too. Not tried on the phone.On the phone (after installing both)
systemctl --user status 'app-geoclue\x2ddemo\x2dagent@autostart.service'should say masked.pgrep -a -u $USER -f demos/agentshould find nothing while Location is off.systemctl --user is-active omamobile-geoclue-agentshould say active, with onedemos/agentprocess.systemctl --user start omamobile-weather; journalctl --user -u omamobile-weather -n 5should show a fetch with source location, and the lock glance and widget should show weather.🤖 Generated with Claude Code
https://claude.ai/code/session_01BeEcdVeSfyLCbijF8XQF1d