danth / stylix

System-wide colorscheming and typography for NixOS
https://stylix.danth.me/
MIT License
1.16k stars 143 forks source link

fails to load .svg, .webp wallpaper #48

Closed cmoog closed 1 year ago

cmoog commented 1 year ago

Fails to build when stylix.image is set to a .svg or .webp asset. This is especially frustrating because it seems to fail even when the base16Scheme is set manually.

Error log

       last 10 log lines:
       > Jpeg Invalid marker used
       > PNG Invalid PNG file, signature broken
       > Bitmap Invalid Bitmap magic identifier
       > GIF Invalid Gif signature : <svg w
       > HDR Invalid radiance file signature
       > Tiff Invalid endian tag value
       > TGA not enough bytes
       >
       > CallStack (from HasCallStack):
       >   error, called at Stylix/Main.hs:22:26 in main:Main
danth commented 1 year ago

Setting base16Scheme should disable the palette generator, so I'm not sure why that is still running.

dwarfmaster commented 1 year ago

It's still running because it is linked from /etc/stylix/palette.json, I will try to see if I can fix that later.

dwarfmaster commented 1 year ago

Ok so the problem is that we want to store the generated palette to make sur it isn't garbage collected (in which case the generation will be run again even if nothing changed). The drawback of the current setup is that it always evaluates the generated scheme. I am not sure how to detect if the theme has been generated or not without running the generation, so I think I'll have to add an explicit option to disable generation. EDIT: turns out I found a way to do it, see #56