Git Product home page Git Product logo

Comments (8)

jonls avatar jonls commented on May 13, 2024

I think that is reasonable. I'm wondering if it should also cache the last location returned by Geoclue and use that if Geoclue becomes unavailable. Then the question is, should the cache or the manual setting be preferred?

from redshift.

Phyks avatar Phyks commented on May 13, 2024

๐Ÿ‘ for the geoclue caching.

I'd say the cached value as you can still temporary force the manual value to be used by disabling the geoclue method.

from redshift.

maandree avatar maandree commented on May 13, 2024

I agree with Physks, but definitely print a warning.

from redshift.

allentiak avatar allentiak commented on May 13, 2024

More information on Launchpad: https://bugs.launchpad.net/ubuntu/+source/redshift/+bug/868904

from redshift.

igorrs avatar igorrs commented on May 13, 2024

Complementing the great ideas already suggested, I'd propose the following scheme:

  • Don't exit if no network connection is available. Just keep trying to query GeoClue and, meanwhile, use cached coordinates.
  • Cache the last used coordinates, no matter if they came from GeoClue or were specified manually.

This way:

  • Users that don't expect to have an Internet connection can set the coordinates manually (once) and have them cached.
  • Users that don't have a connection at startup (but usually do afterwards) can have cached coordinates used at startup, but updated when possible.

from redshift.

eddie-dunn avatar eddie-dunn commented on May 13, 2024

@igorrs, that solution won't work if it fails the first time you try starting the program (happened to me).

It was kind of confusing for me when redshift-gtk wouldn't start, and I had to guess that manually providing lat+long would magically make the program work. Imagine some total n00b trying to run it, and have it just silently fail. They will (rightly) conclude that the program is broken.

I say that if a location is not available, for whatever reason, the program should gracefully fallback to using the local time for setting the redshift. Red between 21:00 and 06:00 would be fine, I think.

from redshift.

llucax avatar llucax commented on May 13, 2024

It was kind of confusing for me when redshift-gtk wouldn't start, and I had to guess that manually providing lat+long would magically make the program work. Imagine some total n00b trying to run it, and have it just silently fail. They will (rightly) conclude that the program is broken.

What you could do in this case is start the daemon but just let the screen untouched until you can get a location (probably showing a warning to the user). Not starting the daemon at all doesn't make all that sense :)

from redshift.

llucax avatar llucax commented on May 13, 2024

I say that if a location is not available, for whatever reason, the program should gracefully fallback to using the local time for setting the redshift. Red between 21:00 and 06:00 would be fine, I think.

You could probably get a bit smarter and adjust that given the date and timezone...

from redshift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.