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

feat: pause/resume auto wallpaper sequence #68

Merged
merged 7 commits into from
Jun 5, 2024

Conversation

Rolv-Apneseth
Copy link
Contributor

@Rolv-Apneseth Rolv-Apneseth commented Jun 2, 2024

Hey again. This is in relation to #48.

What do you think of this fairly basic approach? I can take a whole different one if you prefer / have any suggestions.

Edit: This should also fix the current issue with the Cargo.lock file as it appears it wasn't updated

@danyspin97
Copy link
Owner

Hey @Rolv-Apneseth, I am always happy to see a PR from you :)

The basic approach is fine, but I'd like to entirely remove the timer event, so that wpaperd doesn't wake up. This might be especially good for energy saving scenarios. Implementing this approach requires playing with the event queue handle in the main loop, but it shouldn't be too complex either. The event_source in Surface could become an enum like this:

enum Timer {
   Running(RegistrationToken),
   NotSet,
   // the time passed after the last timer sent an event
   // so that we might start the timer with this duration
   Paused(Duration), 
}

We still need paused property (or rather to_pause) so that the main loop knows which surfaces to modify (the event queue handle is only accesible from the main loop).

Take these suggestions as ideas, it might be possible I am missing some details and that the implementation might be different. What do you think about this approach?

@Rolv-Apneseth
Copy link
Contributor Author

Sure yeah, I'll have a look at following this approach and come back if I have any issues/questions, thanks

@Rolv-Apneseth
Copy link
Contributor Author

Ok - let me know what you think as I'm not too sure I took the correct approach. Also let me know if I should add any docs to the README or anywhere else

@danyspin97
Copy link
Owner

The PR looks good to me, thank you for adding this feature!

@danyspin97 danyspin97 merged commit e6c0b73 into danyspin97:main Jun 5, 2024
8 checks passed
@Rolv-Apneseth
Copy link
Contributor Author

Nice, and no problem.

@Rolv-Apneseth Rolv-Apneseth deleted the pause-wallpaper branch June 5, 2024 15:27
@Rolv-Apneseth
Copy link
Contributor Author

Can #48 be closed or would you also like a toggle rather than just pause/resume?

@danyspin97
Copy link
Owner

I think a toggle would be helpful, especially for people that uses keybindings for controlling wpaperd behavior, especially since its implementation is straightforward.

@Rolv-Apneseth
Copy link
Contributor Author

Alright sure, I'll do a quick PR when I get the time then. Just adding an option to toggle right, not replacing the pause/resume ones?

@danyspin97
Copy link
Owner

That would be perfect, thank you! Yes, just a toggle command.

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