rocksdanister / lively

Free and open-source software that allows users to set animated desktop wallpapers and screensavers powered by WinUI 3.
https://rocksdanister.com/lively
GNU General Public License v3.0
14.41k stars 1.03k forks source link

Local storage for Shadertoy wallpapers #202

Open EvelynSubarrow opened 3 years ago

EvelynSubarrow commented 3 years ago

I've got a slightly flaky internet connection, sometimes there's issues when starting up, and delays when switching between wallpapers which use shadertoy.

It'd be nice if it were possible to store these wallpapers locally. Ideally, lively would cache a copy, preferring a live version if/when it's available, with a setting to change this behaviour on an individual wallpaper and globally - options could be cache and don't try to get live, cache but prefer live, don't cache at all

rocksdanister commented 3 years ago

Looks like CefSharp don't support this feature: https://stackoverflow.com/questions/54298505/cefsharp-chromiumwebbrowser-load-from-cache-without-network-connection

Curious, which shadertoy shaders are you using as wallpaper? It's certainly possible to write a custom offline shader loader like the Rain v2 wallpaper etc..

amaitland commented 3 years ago

You should be able to implement a service worker to handle caching.

rocksdanister commented 3 years ago

Did you search for CefSharp keyword sorted by new issues 😃

You should be able to implement a service worker to handle caching.

Thanks. Looks like its a Javascript thing, will need to look into it. Although for this particular case a custom shader loader is another option.

For future reference: https://developers.google.com/web/fundamentals/primers/service-workers

amaitland commented 3 years ago

Did you search for CefSharp keyword sorted by new issues 😃

I have a saved search that I check occasionally 😄

Looks like its a Javascript thing, will need to look into it. Although for this particular case a custom shader loader is another option.

You can probably do that without actually using a service working just using the Cache implementation. See https://developer.mozilla.org/en-US/docs/Web/API/Cache

EvelynSubarrow commented 3 years ago

Looking at the rain repo, I think I understand how that works, I'll see if I can do something similar, thanks for the pointer. The shader in question is mostly this one:

https://www.shadertoy.com/view/WsdfRH

rocksdanister commented 3 years ago

Lively has built in wallpaper recorder to create video wallpaper now - you can try that: https://youtu.be/cPV_e6psq1g