Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schedule dark mode #7

Merged
merged 25 commits into from
Sep 29, 2020
Merged

Conversation

meisenzahl
Copy link
Member

Moved from elementary/gala#863

Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting this pull request! I left a few comments inline

data/io.elementary.SettingsDaemon.AccountsService.xml Outdated Show resolved Hide resolved
src/Backends/ColorSettings.vala Outdated Show resolved Hide resolved
src/Backends/ColorSettings.vala Outdated Show resolved Hide resolved
@meisenzahl
Copy link
Member Author

Does anyone have an idea how I can query sunrise and sunset via DBUS? org.gnome.SettingsDaemon.Color properties' sunrise and sunset always return -1.0

@meisenzahl
Copy link
Member Author

It seems I need to port the logic to calculate sunrise and sunset from gnome-settings-daemon to Vala 🙈

@meisenzahl meisenzahl marked this pull request as ready for review August 20, 2020 18:51
@meisenzahl
Copy link
Member Author

It works 🤓

@meisenzahl
Copy link
Member Author

Related to #2

@cassidyjames
Copy link
Contributor

cassidyjames commented Aug 25, 2020

One other question I had: what is the UX of the failure state here, i.e. if GeoClue can't get a location? Do we have default times to fall back to (like 8 PM to 6 AM or something), will the dark style just never trigger, or will it potentially trigger at a strange time?

@danirabbit
Copy link
Member

That's actually something I was thinking about as well. It looks like GSD saves last known coordinates for night light. It might be a good thing for us to do that too and fall back to some reasonable time if that's never been set before

@meisenzahl
Copy link
Member Author

Does anyone have an idea how I can query sunrise and sunset via DBUS? org.gnome.SettingsDaemon.Color properties' sunrise and sunset always return -1.0

Originally posted by @meisenzahl in elementary/gala#863 (comment)

(like 8 PM to 6 AM or something)

So sane defaults as suggested by @cassidyjames?

Copy link
Member

@davidmhewitt davidmhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! I've added an initial set of comments about the code.

src/Backends/PrefersColorSchemeSettings.vala Outdated Show resolved Hide resolved
src/Backends/PrefersColorSchemeSettings.vala Outdated Show resolved Hide resolved
src/Backends/PrefersColorSchemeSettings.vala Outdated Show resolved Hide resolved
src/Backends/PrefersColorSchemeSettings.vala Outdated Show resolved Hide resolved
Copy link
Member

@davidmhewitt davidmhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes, starting to look better!

I have another few comments

src/Backends/PrefersColorSchemeSettings.vala Show resolved Hide resolved
src/Backends/PrefersColorSchemeSettings.vala Outdated Show resolved Hide resolved
src/Backends/PrefersColorSchemeSettings.vala Outdated Show resolved Hide resolved
src/Backends/PrefersColorSchemeSettings.vala Outdated Show resolved Hide resolved
Copy link
Member

@davidmhewitt davidmhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code looks really good now. I've left two very minor comments.

I've done some limited testing and it seems to work well too.

Thanks again for all your work on this, and sorry it took so long to re-review.

src/Backends/PrefersColorSchemeSettings.vala Show resolved Hide resolved
src/Backends/PrefersColorSchemeSettings.vala Outdated Show resolved Hide resolved
@davidmhewitt
Copy link
Member

I should add that I'm happy for this to be merged once my last two comments above are resolved!

@meisenzahl
Copy link
Member Author

@davidmhewitt Ready for review

@meisenzahl
Copy link
Member Author

@danrabbit Do you want to review? 🙂

@danirabbit
Copy link
Member

I've been running this for a while now so functionality works as expected in my usage. Nice job :)

@danirabbit danirabbit merged commit b61f3ff into elementary:master Sep 29, 2020
@meisenzahl meisenzahl deleted the schedule-dark-mode branch September 29, 2020 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants