You are not logged in.

#1 2025-05-30 16:27:40

bsep
Member
Registered: 2025-01-04
Posts: 5

Help with geoclue

Hi.

Is anybody experience issues getting current location in browsers (firefox/chromium) ? Search in web i understand that firefox uses `geoclue` to get my current location and firefox retires the MLS (mozilla location service). For that reason i created a file in `/etc/geolocation` to set lat/long manually.

and works, but only if i manually start a `agent` in the terminal using `/usr/lib/geoclue-2.0/demos/agent &`. But when i restart my pc, the agent isnt running anymore and firefox cant find my locale. Am i missing anything?

Also, the workaround descript above does not works for chromium.

##

geoclue.conf

# Configuration file for Geoclue
#
# NOTE: All configurations settings below are mandatory and the defaults are
#       what you see before you edit them. If you want to keep the default
#       values around, copy and comment out the appropriate line(s) before
#       changing them.

# Agent configuration options
[agent]

# Whitelist of desktop IDs (without .desktop part) of all agents we recognise,
# separated by a ';'.
whitelist=geoclue-demo-agent;gnome-shell;io.elementary.desktop.agent-geoclue2;sm.puri.Phosh;lipstick

# Network NMEA source configuration options
[network-nmea]
# Fetch location from NMEA sources on local network?
enable=false
# use aa nmea unix socket as the data source
# nmea-socket=/var/run/gps-share.sock
# 3G source configuration options
[3g]
# Enable 3G source
enable=false

# CDMA source configuration options
[cdma]
# Enable CDMA source
enable=false

# Modem GPS source configuration options
[modem-gps]
# Enable Modem-GPS source
enable=false

# WiFi source configuration options
[wifi]
# Enable WiFi source
# If this source and the static source below are both disabled a GeoIP-only
# source will be used instead.
enable=false

# URL to a WiFi geolocation service compatible with the Ichnaea API
# ([url]https://ichnaea.readthedocs.io/en/latest/api/geolocate.html[/url]).
# An API key can be set by using the 'key' URL parameter.
#url=https://example.com/v1/geolocate?key=YOUR_KEY

# To use the Google geolocation service, uncomment this URL
# while changing YOUR_KEY to your Google API key.
#
# WARNING: Please make sure that you are complying with the Google's ToS and
#          policies if you uncomment this:
#
# [url]https://developers.google.com/maps/documentation/geolocation/policies[/url]
#
#url=https://www.googleapis.com/geolocation/v1/geolocate?key=YOUR_KEY

# Submit data to WiFi geolocation service
# If set to true, geoclue will automatically submit network data
# each time it gets a GPS lock.
#
# Currently, only Modem-GPS or Network NMEA sources are supported as providers
# of a location to submit (one at a time).
# If Modem-GPS source is enabled above it will be the exclusive provider
# (regardless whether the system is actually equipped with such modem),
# otherwise Network NMEA source will be considered.
#
submit-data=false

# URL to submit data to a WiFi geolocation service with an Ichnaea compatible API
# ([url]https://ichnaea.readthedocs.io/en/latest/api/geosubmit2.html[/url]).
#submission-url=https://example.com/v2/geosubmit?key=YOUR_KEY

# A nickname to submit network data with. If empty, omitted from the submission.
# Otherwise, must be 2 to 32 characters long. Defaults to "geoclue".
submission-nick=geoclue

# Compass configuration options
[compass]
# Enable Compass
enable=true

# Static source configuration options
#
# This source reads location from "geolocation" file in /etc - please
# consult geoclue(5) man page for the format description of this file.
[static-source]
# Enable the static source
# If you make use of this source, you probably should disable other location
# sources in this file so they won't override the configured static location.
enable=true

 Application configuration options
#
# NOTE: Having an entry here for an application with allowed=true means that
#       geoclue will not ask agent to authorize the application. This is to
#       ensure that applications with built-in authorization mechanism (e.g web
#       browsers) do not have to be bound to agents.
#
#       If your application is denied access to location information and your
#       operating system doesn't provide any mechanism to change that, it is
#       likely a bug in your operation system (or geoclue). The solution is to
#       report the issue with all details, rather than adding your application
#       to this list.
#
# Format:
#
# # Desktop ID of application without .desktop part
# [random-app]
#
# # Allowed access to location information?
# allowed=true|false
#
# # Is application a system component?
# system=true|false
#
# # List of UIDs of all users for which this application is allowed location
# # info access, separate by ';'. Keep it empty for allowing it for all users.
# users=

[gnome-datetime-panel]
allowed=true
system=true
users=

[gnome-color-panel]
allowed=true
system=true
users=

[org.gnome.Shell]
allowed=true
system=true
users=

[io.elementary.desktop.agent-geoclue2]
allowed=true
system=true
users=

[sm.puri.Phosh]
allowed=true
system=true
users=

[epiphany]
allowed=true
system=false
users=

[firefox]
allowed=true
system=false
users=

[lipstick]
allowed=true
system=true
users=

###

/etc/geolocation

-15.xxx
-48.xxx
1.xxx
5.xxx

im not using gnome, just using arch + hyprland

Last edited by bsep (2025-05-30 22:56:08)

Offline

#2 2025-05-30 20:12:15

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,287

Re: Help with geoclue

Please use [code][/code] tags. Edit your post in this regard.

https://wiki.archlinux.org/title/Redshi … to_GeoClue
Ignore the context, apparently xdg autostart doesn't work, so simply start the daemon w/ your session scripts or use a user service.

Offline

#3 2025-05-30 22:58:23

bsep
Member
Registered: 2025-01-04
Posts: 5

Re: Help with geoclue

seth wrote:

Please use [code][/code] tags. Edit your post in this regard.

https://wiki.archlinux.org/title/Redshi … to_GeoClue
Ignore the context, apparently xdg autostart doesn't work, so simply start the daemon w/ your session scripts or use a user service.

Thanks, i just use `exec-once` on hyperland conf to start the daemon and works. I have a couple of following questions if you may answer.

1 - Is there any service to replace mozilla location service?
2 - This workaround  doest not works on chromium and i cant get my current location in this browser, any thoughts on what could be the reason?

Offline

#4 2025-05-31 07:03:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,287

Re: Help with geoclue

https://gitlab.archlinux.org/archlinux/ … 3d43bbfa0f
Afaiu mozila closed shop.

CHromium doesn't seem to support it: https://issues.chromium.org/issues/40699142

I btw. googled both of them. All I really know about geoclue is that I'm not gonna use it…

Offline

#5 2025-05-31 13:09:31

bsep
Member
Registered: 2025-01-04
Posts: 5

Re: Help with geoclue

seth wrote:

I btw. googled both of them. All I really know about geoclue is that I'm not gonna use it…

why not? is there any alternatives to it? i googled it but couldnt find any alternatives, every distro seems  to use geoclue with some provider now thats  mozilla retire mls

Last edited by bsep (2025-05-31 13:10:19)

Offline

#6 2025-05-31 14:48:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,287

Re: Help with geoclue

I've not yet found a reason to inform random processes about my geographic whereabouts or let some web service know that I'm interested in that (and with what client)

Offline

Board footer

Powered by FluxBB