Skip to content

Conversation

@MrSloth-dev
Copy link

Added a paramater of '-ti' or '--time' that receives the dawn and sunset hour in HH:MM format (24hours) and then converts to float so that you can compare with the actual time. then it activates the identity matrix (or not) according to time.

I tried to minimize the impact of the current code to help the review.

If continuous monitoring (run the program once and when the sunset arrives it activates) is needed/wanted, then it needs to change the main stucture of the code( as far as i know) to encapsulate the screen change in a function so that it can runs on a loop ( maybe integrate in wayland loop?).

    while (wl_display_dispatch(state.wlDisplay) != -1) {
        monitorAndUpdate(dawn,  sunset,  KELVIN, std::ref(identity));
        ;
    }

Best regards and thank you for this little program. Happy to contribute.

added a paramater of '-ti' or '--time' that receives the dawn and sunset
hour in HH:MM format (24hours) and then converts to float so that you
can compare with the actual time. then it activates the identity matrix
(or not) according to time.
@vaxerski
Copy link
Member

vaxerski commented Dec 8, 2024

If continuous monitoring (run the program once and when the sunset arrives it activates) is needed/wanted, then it needs to change the main stucture of the code( as far as i know) to encapsulate the screen change in a function so that it can runs on a loop ( maybe integrate in wayland loop?).

It is wanted (I believe without it this is quite useless) but the method you're thinking of is wrong. See https://github.com/hyprwm/hyprlock/blob/cc7ffe73e7588137eb239239da0d83fe334b3ddd/src/core/hyprlock.cpp#L433-L583

it might be out of your scope (idk your C++ proficiency) but if you're up to the challenge feel free to implement this. Probably need to move hyprsunset into a singleton to stay on point with our code style (see g_pHyprlock, in that case)

@MrSloth-dev
Copy link
Author

I'm more a C guy, but in my spare time I will search about what you asking and if I get somewhere I'll let you know. In meantime I think my present proposal al least can be used for later iterations. Good work :)

@andreaschar15
Copy link

Hey was looking into this today. Can this be merged or is there more work to be done. It would be an amazing feature for hyprsunset.

@salfel
Copy link
Contributor

salfel commented Jul 21, 2025

Hey was looking into this today. Can this be merged or is there more work to be done. It would be an amazing feature for hyprsunset.

Hyprsunset now supports a configuration file where one can specify when to apply which settings. That might be something you want to check out

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