danth / stylix

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

dimming background image #45

Closed i-am-logger closed 1 year ago

i-am-logger commented 1 year ago

Sometimes I have background images that are bright, will be nice to be able to have the ability to dimm the image.

stylix = {
   polarity = "dark";
   image "..."
   image-dimming = "0.3";
}
danth commented 1 year ago

You could pass the file through ImageMagick before setting it as the background:

{ pkgs, ... }:

{
  stylix.image = pkgs.runCommand "image.jpg" {} ''
    ${pkgs.imagemagick}/bin/magick ${./image.jpg} -level 0%,100%,0.5 $out
  '';
}
i-am-logger commented 1 year ago

Perfect! Will check it out

dwarfmaster commented 1 year ago

I think starting to add wallpaper transformations should be considered outside of the scope of the project, since they are easily worked around. However we could have a TRICKS.md with a list of examples of how to do this kind of things.