mirror of
https://github.com/danth/stylix
synced 2025-02-16 13:28:35 +00:00
Add trick with dynamic wallpaper generation (#135)
This commit is contained in:
parent
2719a57e2b
commit
c29f2e6f9d
1 changed files with 23 additions and 0 deletions
|
@ -21,3 +21,26 @@ in
|
|||
'';
|
||||
}
|
||||
```
|
||||
|
||||
## Dynamic wallpaper generation based on selected theme
|
||||
|
||||
With imagemagick, you can also dynamically generate wallpapers based on the selected theme.
|
||||
Similarly, you can use a template image and repaint it for the current theme.
|
||||
|
||||
```nix
|
||||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
theme = "${pkgs.base16-schemes}/share/themes/catppuccin.yaml";
|
||||
wallpaper = pkgs.runCommand "image.png" {} ''
|
||||
COLOR=$(${pkgs.yq}/bin/yq -r .base00 ${theme})
|
||||
COLOR="#"$COLOR
|
||||
${pkgs.imagemagick}/bin/magick convert -size 1920x1080 xc:$COLOR $out
|
||||
'';
|
||||
in {
|
||||
stylix = {
|
||||
image = wallpaper;
|
||||
base16Scheme = theme;
|
||||
};
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue