Community Packages

Please read this before reporting a bug:
http://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#59657 - [redshift] Make geoclue2 support optional

Attached to Project: Community Packages
Opened by Peter Wu (Lekensteyn) - Tuesday, 14 August 2018, 10:29 GMT
Last edited by Eli Schwartz (eschwartz) - Tuesday, 14 August 2018, 22:20 GMT
Task Type Feature Request
Category Packages
Status Assigned
Assigned To Lukas Fleischer (lfleischer)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 2
Private No

Details

Description:
With the manual location provider (see "man redshift"), geoclue2 is no longer needed.
Tested with "pacman -R --assume-installed geoclue2 geoclue2", redshift in manual mode still works.

The default configuration will still try to access geoclue2 (via DBus) though, so unless you specify manual mode, you will still need geoclue.

Additional info:
* package version: redshift 1.12-2
This task depends upon

Comment by Eli Schwartz (eschwartz) - Tuesday, 14 August 2018, 18:06 GMT
Do people typically specify their location hardcoded, or use geoclue2 to dynamically find out? What happens when geoclue2 is not installed but redshift tries to use it -- does it ask you to specify a manual location, or abort with a confusing error message?
Comment by Peter Wu (Lekensteyn) - Tuesday, 14 August 2018, 20:30 GMT
I am not sure what people usually do, but personally I have set a fixed location as since I am not moving countries very often. When geoclue is not enabled (or no internet connection is available), it will sit there forever:

$ redshift -c /dev/null
Trying location provider `geoclue2'...
Using provider `geoclue2'.
Using method `randr'.
Waiting for initial location to become available...
^Cpoll: Interrupted system call
Unable to get location from provider.
$ redshift -c /dev/null -l manual:0:0
Using method `randr'.
Waiting for initial location to become available...
Location: 0.00 N, 0.00 E
^C
$

If the provider is specified, it will use that. Otherwise it will use a default:
Except for disabling geoclue at compile time, it will always try to use geoclue first and only then it will try manual mode.

That "fallback to manual mode" is not really a fallback. In the current implementation, it will always consider geoclue2 available. It will just watch the D-Bus forever until org.freedesktop.GeoClue2 appears (never in case not installed).

The reason why I removed geoclue is for two reasons (1) privacy, I do not need to broadcast/receive my location all times (2) a new useless "agent" daemon would somehow start every time I relogin.

Setting the location manually is recommended in some issues such as
https://github.com/jonls/redshift/issues/318
Comment by Eli Schwartz (eschwartz) - Tuesday, 14 August 2018, 22:20 GMT
> In the current implementation, it will always consider geoclue2 available. It will just watch the D-Bus forever until org.freedesktop.GeoClue2 appears (never in case not installed).

That sounds like an upstream bugreport in the making. :D As well as that, bug aside, geoclue2 would seem to be intended to be optional.
Comment by Peter Wu (Lekensteyn) - Wednesday, 15 August 2018, 10:32 GMT
Not mentioned in the original report, but potentially relevant: I am using Plasma (not GNOME).

> > It will just watch the D-Bus forever until org.freedesktop.GeoClue2 appears.
>
> That sounds like an upstream bugreport in the making. :D

It could be a feature, GeoClue2 is autostarted on first use so it might not be immediately available. Some form of detection for GeoClue2 availability or a timeout could be nice though. I'll what I can do :)

[rant]
I suppose that the "agent" exists to confirm location requests from applications, though I was never asked for it. The source tree has no tests at all that check for such things.
Why does this thing need to run as root? I am glad that I got rid of it.
[/rant]
Comment by Peter Wu (Lekensteyn) - Wednesday, 15 August 2018, 12:36 GMT
Proposed PR to detect availability of GeoClue2 and immediately fallback to manual mode:
https://github.com/jonls/redshift/pull/656
Comment by Maxim Baz (maximbaz) - Tuesday, 22 January 2019, 08:01 GMT
I support making geoclue2 an optional dependency. First of all, by having geoclue2 installed redshift is still unable to use it by default, see this thread starting from [1] for example. There is some agent that has to be running, so people need to investigate and implement some manual intervention anyway. Secondly, there's no need to bloat the system for people who don't use geoclue provider.

Upstream is quite slow at merging PRs, but I think it shouldn't stop us from demoting geoclue2 to optional dependency, having it installed by default seems to give little to no benefits.

1: https://github.com/jonls/redshift/issues/318#issuecomment-407446604
Comment by dummys (dummys) - Sunday, 26 September 2021, 15:38 GMT
+1 please can we demote geoplus as an optional dependency. As it is useless for people that don't move a lot, as we can put the location manually. Thanks

Loading...