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

Added Activation with time @ startup of the program #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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 :)

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