Geoclue

Overview

Geoclue can query geolocation services following the Mozilla Ichnaea API specification to determine the location based on the IP address. By default, geoclue uses the Mozilla Location Service (MLS) which was sunset in 2024.

Alternative location services

Instead of the now-defunct MLS, a few other services can be used (in the [wifi] section):

position.xyz

Noncommercial alternative to MLS where accounts have to be requested via mail (a rate-limited token test is available). url=https://api.positon.xyz/v1/geolocate?key=test

beacondb.net

Open service without API token. url=https://api.beacondb.net/v1/geolocate

Offline Location Service

As a device-local server with cache that calls other services under the hood.

Static location

Geoclue also supports setting a static location in case the dynamic providers don't work or aren't desired. The location can be specified as four lines (latitude, longitude, altitude, accuracy radius) in the file /etc/geolocation. If more locked-down permissions are desired, this file can be owned by geoclue with permissions 0600. Here's an example file for Vienna, Austria:

48.197
16.356
190
10

Gammastep

Gammastep is the Wayland alternative for redshift. It supports detecting sunrise/sunset times based on the geolocation via geoclue2, or manual. In case of the latter, the location can be specified in the configuration file under a [manual] section:

[general]
location-provider=manual

[manual]
; vienna, austria
lat=48.21
lon=16.37

If a static geolocation (via the /etc/geolocation file) is specified, we can just set location-provider=geoclue2 though.

Wayland

To specify the displays that should be color-corrected, specify them in the [wayland] section (wildcards supported):

[general]
adjustment-method=wayland

[wayland]
output=*