Daytime/nighttime temperatures #73

Open
by pfheatwole opened 1 year ago · 6 comments
pfheatwole commented 1 year ago (Migrated from github.com)
Owner

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.

**Checklist:** - [x] I realise this extension extends on the existing GNOME night light feature and can only control the temperature. - [x] 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 commented 1 year ago (Migrated from github.com)
Owner

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 😄

Interesting feature :smile: ``` [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](https://user-images.githubusercontent.com/5292862/95289986-a9dfe180-085b-11eb-9856-b917e277c07b.png) Otherwise just like Redshift, I may need to rely on Geoclue for this information. I'll keep this mind and explore available options :smile:
pfheatwole commented 1 year ago (Migrated from github.com)
Poster
Owner

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.

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 commented 1 year ago (Migrated from github.com)
Poster
Owner

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

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 commented 1 year ago (Migrated from github.com)
Poster
Owner

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.) 😄

> 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.) :smile:
kiyui commented 1 year ago (Migrated from github.com)
Owner

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 😬

> the night light must always be on in order to set the temperature Yeah, exactly the issue :smile: 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 :sweat_smile: 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 :grimacing:

One possible way to use Gnome's time and location tracking is to not use an "always on" schedule, but instead change the settings when the day/night period changes.

If a fixed schedule is selected, you can just adjust the temperature and switch the start/end times when the end time is reached.

An automatic sunset to sunrise schedule may be more tricky, but in an earlier comment you said that Gnome provides the values somewhere when it's not "akways on". So, at night you can store those values. Then when the day comes, you can switch to a fixed schedule until sunset, and then back to automatic.

One possible way to use Gnome's time and location tracking is to not use an "always on" schedule, but instead change the settings when the day/night period changes. If a fixed schedule is selected, you can just adjust the temperature and switch the start/end times when the end time is reached. An automatic sunset to sunrise schedule may be more tricky, but in an earlier comment you said that Gnome provides the values somewhere when it's not "akways on". So, at night you can store those values. Then when the day comes, you can switch to a fixed schedule until sunset, and then back to automatic.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.