Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Daytime/nighttime temperatures #73

Open
2 tasks done
pfheatwole opened this issue Oct 7, 2020 · 5 comments
Open
2 tasks done

Daytime/nighttime temperatures #73

pfheatwole opened this issue Oct 7, 2020 · 5 comments
Assignees

Comments

@pfheatwole
Copy link

Checklist:

  • I realise this extension extends on the existing GNOME night light feature and can only control the temperature.
  • I have gone through the extension settings to check that this feature is unavailable.

Feature Description:
It would be helpful to have the "permanent night light" option, but with variable temperature based on time of day. For example, I currently use Redshift to set my display to 5300k during the day, and 3500k during the evening, which is great for reducing daytime eyestrain.

@kiyui kiyui self-assigned this Oct 7, 2020
@kiyui
Copy link
Owner

kiyui commented Oct 7, 2020

Interesting feature 😄

[redshift]
; Set the day and night screen temperatures
temp-day=5700
temp-night=3500

; Enable/Disable a smooth transition between day and night
; 0 will cause a direct change from day to night screen temperature.
; 1 will gradually increase or decrease the screen temperature.
transition=1

I suppose a difficulty here would be to determine the sunset/sunrise time in a given location, because the Enable permanent Night Light option overrides the values that GNOME provides in order to have the Night Light present even throughout the day,

Screenshot from 2020-10-07 05-11-38

Otherwise just like Redshift, I may need to rely on Geoclue for this information. I'll keep this mind and explore available options 😄

@pfheatwole
Copy link
Author

pfheatwole commented Oct 7, 2020

It looks like your extension is allowed to set org.gnome.settings-daemon.plugins.color.night-light-schedule-from (and night-light-schedule-to). Are you also allowed to read those values?

If you can, it seems like the simplest solution would be to let Gnome manage the schedule, then the extension simply needs to check if the current time is between the from/to range. If yes, set the nighttime temperature; if no, set the daytime temperature.

@pfheatwole
Copy link
Author

One "downside" is that setting daytime/nighttime temperatures based on the from/to would overlap with this extension's "always on" feature, since "always on" would be functionally equivalent to making the daytime and nighttime temperatures the same.

On the other hand, it looks like the Gnome developers implemented "always on" about a year ago (https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/83), so this might be one way for this extension to continue providing extra functionality without overlapping built-in features. It doesn't sound like they're interested in adding a "daytime" temperature: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/20

@pfheatwole
Copy link
Author

It looks like your extension is allowed to set org.gnome.settings-daemon.plugins.color.night-light-schedule-from (and night-light-schedule-to). Are you also allowed to read those values?

If you can, it seems like the simplest solution would be to let Gnome manage the schedule

Had a moment to toy with this and realized my suggestion is broken, partly because the from/to aren't helpful since the night light must always be on in order to set the temperature, and partly because gnome-settings-daemon doesn't seem to update those keys when using automatic scheduling. (You probably already know this, but just in case I don't want to waste anybody's time.) 😄

@kiyui
Copy link
Owner

kiyui commented Oct 8, 2020

the night light must always be on in order to set the temperature

Yeah, exactly the issue 😄 And while I could store the initial night-light-schedule-{from,to} values and shift the schedule accordingly, I would still need to save them elsewhere and know when I can trust the values in there not the be some values I had previously set 😅

One thing I can revisit was where I set night-light-schedule-{from,to} to a 24 hour range, but had to compensate for the smear value 😬

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants