vineetred / flowy

A lean, privacy-preserving dynamic wallpaper changer written in Rust.
GNU General Public License v3.0
277 stars 17 forks source link

Sunsrise/Sunset Folder or Prefix system? #24

Closed vineetred closed 4 years ago

vineetred commented 4 years ago

Is your feature request related to a problem? Please describe. Incorporate Sunset and Sunrise times into wallpaper changing times

Additional context I have implemented that solar timetable program that @Baldomo ported. However, now I am still unsure of how to segregate the wallpapers between dark and bright. Should we have different folders or should we have different prefixes attached to the filename?

If we go with the folder system, it would mean that we have two function that generate the config file -- one for those that want the sunset and sunrise feature and the other for the ones that do not care about this feature.

If we go with the prefix system, it increases the setup overhead of the user.

What method do you guys think Flowy should implement @Aloso @Baldomo @swagggpickle?

Baldomo commented 4 years ago

The actual module I ported returns a table with absolute times in epoch, they can be easily converted to day-local hours using the chrono crate, which is already required by flowy. I can rework the solar_timetable function to return chrono instants fairly trivially and maybe create a PR to add the module into flowy. Should it be a separated crate or would it be better to include it in flowy?

vineetred commented 4 years ago

@Baldomo I've worked on the solar bit already and it's done. I am now planning on implementing the config generator that takes into account these solar times.

Baldomo commented 4 years ago

@vineetred oh alright I was trying to find the changes in the PRs/branches but I couldn't, I presume you still have to push the commit(s)? There may be stuff I have to fix in the solar calculations, not to mention tests to add :)

vineetred commented 4 years ago

@Baldomo do one thing then. Just fork the most up to date version of this repo and work upon this file I am yet to push -- https://gist.github.com/vineetred/9e20d15e8ea1313878fb5071b8e97c14. This is your port but has a few extra functions at the end. Do check it out.

Once you are done with the PR, I'll just merge it

Otherwise, I can push just solar.rs to the repo and you can work on it then. What would you like?

Baldomo commented 4 years ago

Sure, I'll make PR right now

vineetred commented 4 years ago

@Baldomo can you also make a helper function in solar.rs that converts a given time into minutes since midnight? As in, 01:02AM would be 62 minutes since midnight.

Baldomo commented 4 years ago

@vineetred sure thing

vineetred commented 4 years ago

Going ahead with a prefix system. Commit bfb15b1 adds this function.