mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-22 00:03:55 +01:00
stylix: Dynamically generate wallpaper from color scheme
Fixes an issue where previously the background color would be incorrect when the color scheme was changed, which was particularly noticeable on Phosh where the background would display when toggling the on-screen keyboard. Note that the logo has been intentionally left out this time to simplify things a bit.
This commit is contained in:
parent
40c7b04a9a
commit
b4d3190167
Binary file not shown.
Before Width: | Height: | Size: 29 KiB |
@ -4,11 +4,28 @@ let
|
||||
inherit (lib) mkEnableOption mkIf mkMerge mkOption;
|
||||
inherit (lib.types) float int;
|
||||
inherit (config.modules.system) username;
|
||||
inherit (config.lib.stylix.colors) base00;
|
||||
inherit (cfg) bloat gnome plasma container opacity fontSize graphical;
|
||||
inherit (nix-config.packages.${pkgs.system}) aleo-fonts;
|
||||
inherit (pkgs) phinger-cursors noto-fonts-cjk-sans maple-mono noto-fonts-emoji;
|
||||
inherit (pkgs) phinger-cursors noto-fonts-cjk-sans maple-mono noto-fonts-emoji stdenvNoCC imagemagick;
|
||||
inherit (builtins) attrValues;
|
||||
|
||||
stylix-background = stdenvNoCC.mkDerivation {
|
||||
pname = "stylix-background";
|
||||
version = base00;
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
imagemagick
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out
|
||||
magick -size 1x1 xc:#${base00} $out/wallpaper.png
|
||||
'';
|
||||
};
|
||||
|
||||
cfg = config.modules.desktop;
|
||||
in
|
||||
{
|
||||
@ -170,7 +187,7 @@ in
|
||||
|
||||
stylix = {
|
||||
enable = true;
|
||||
image = ../assets/wallpaper.png;
|
||||
image = "${stylix-background}/wallpaper.png";
|
||||
polarity = "dark";
|
||||
base16Scheme = ../assets/selenized-black.yaml;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user