Skip to content

Conversation

@salfel
Copy link
Contributor

@salfel salfel commented Jul 15, 2025

This PR aims to add support for a hyprsunset.conf file.

The user can set different profiles in his config, which will then be applied automatically at the provided time.

max-gamma = 100

profile {
    time = 7:30
    identity = true
}

profile {
    time = 22:00
    temperature = 5500
    gamma = 0.8
}

I have implemented it in a way, so that you could introduce as many profiles as you like. An alternative would be to provide just a day and night profile.

@salfel
Copy link
Contributor Author

salfel commented Jul 15, 2025

I currently made it, so that when passing --temperature or --gamma to the command, this will override the current active profile's temperature/gamma. On the next scheduled profile it would however then use the profile's temperature/gamma. Maybe this functionality has to be discussed

@salfel
Copy link
Contributor Author

salfel commented Jul 15, 2025

For thread safety, i have just added a lock guard in the schedule function. To my understanding this should now be thread-safe. Let me know if it isn't or if I should adopt something different

@vaxerski
Copy link
Member

it's not enough unfortunately. wl_display_dispatch is not thread safe. Any wayland command you execute in another thread can (and eventually will) fuck up the queue and segfault.

@salfel
Copy link
Contributor Author

salfel commented Jul 16, 2025

it's not enough unfortunately. wl_display_dispatch is not thread safe. Any wayland command you execute in another thread can (and eventually will) fuck up the queue and segfault.

Oh, my bad. Didn't understand that the issue lies in the wl_display_dispatch. Will fix that ASAP

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

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

very nice, just a minor style nit.

@vaxerski
Copy link
Member

also run clang-format if you havent

@salfel
Copy link
Contributor Author

salfel commented Jul 17, 2025

also run clang-format if you havent

already did

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

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

lgtm, just needs a wiki mr

@salfel
Copy link
Contributor Author

salfel commented Jul 19, 2025

I'd also like to suggest we now bump the version to 1.0, as this, in my opinion marks a big milestone in the usability of hyprsunset

@vaxerski
Copy link
Member

I'd also like to suggest we now bump the version to 1.0, as this, in my opinion marks a big milestone in the usability of hyprsunset

we don't do 1.x

@salfel
Copy link
Contributor Author

salfel commented Jul 20, 2025

I'd also like to suggest we now bump the version to 1.0, as this, in my opinion marks a big milestone in the usability of hyprsunset

we don't do 1.x

oops my bad, then 0.3 right

@vaxerski
Copy link
Member

ye

@vaxerski vaxerski merged commit f663619 into hyprwm:main Jul 20, 2025
1 check passed
@1over137 1over137 mentioned this pull request Jul 28, 2025
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.

2 participants