Skip to content

omamobile-gnss 0.2.6, omamobile-shell 0.2.86: one GeoClue agent, and weather works with Location on - #359

Merged
derekross merged 2 commits into
mainfrom
weather-geoclue-agent
Nov 2, 2026
Merged

derekross merged 2 commits into
mainfrom
weather-geoclue-agent

Conversation

@derekross

Copy link
Copy Markdown
Owner

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 through xdg-desktop-autostart.target) ran GeoClue's demo agent at every login, Location on or off. Turning Location on 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. omamobile-weather's geoclue_usable() wanted that unit active, so it logged "no place (Location off, ...): nothing fetched".

omamobile-gnss 0.2.6

  • Masks the unit the generator makes of geoclue's file, app-geoclue\x2ddemo\x2dagent@autostart.service (the generator escapes dashes; checked against the real generator), with a /dev/null link in /usr/lib/systemd/user. That directory comes before generator.late in 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.service stops 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.
  • Tests: the generator's unit name (when the generator is installed), the mask in the install script and the staged package, and the ExecStartPre line. The CI-visible checks run before the prebuilt-only part.

omamobile-shell 0.2.86

Checks

packages/omamobile-gnss/test/all passes, with and without the bionic prebuilts. packages/omamobile-shell/test/all, tests/all and tools/pr-check origin/main pass too. Not tried on the phone.

On the phone (after installing both)

  1. Log out and back in, or reboot. systemctl --user status 'app-geoclue\x2ddemo\x2dagent@autostart.service' should say masked. pgrep -a -u $USER -f demos/agent should find nothing while Location is off.
  2. Turn Location on from quick settings. systemctl --user is-active omamobile-geoclue-agent should say active, with one demos/agent process.
  3. systemctl --user start omamobile-weather; journalctl --user -u omamobile-weather -n 5 should show a fetch with source location, and the lock glance and widget should show weather.
  4. Turn Location off. The agent stops, and the next weather run doesn't ask GeoClue.
  5. Upgrade path, without logging out (the autostart agent is still running): turn Location on. Our unit should stop the old agent and run active.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BeEcdVeSfyLCbijF8XQF1d

derekross and others added 2 commits November 2, 2026 18:05
…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
@derekross
derekross merged commit 37d6adc into main Nov 2, 2026
2 checks passed
@derekross
derekross deleted the weather-geoclue-agent branch November 2, 2026 23:25
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
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.

1 participant