mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-25 01:33:17 +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) mkEnableOption mkIf mkMerge mkOption;
|
||||||
inherit (lib.types) float int;
|
inherit (lib.types) float int;
|
||||||
inherit (config.modules.system) username;
|
inherit (config.modules.system) username;
|
||||||
|
inherit (config.lib.stylix.colors) base00;
|
||||||
inherit (cfg) bloat gnome plasma container opacity fontSize graphical;
|
inherit (cfg) bloat gnome plasma container opacity fontSize graphical;
|
||||||
inherit (nix-config.packages.${pkgs.system}) aleo-fonts;
|
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;
|
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;
|
cfg = config.modules.desktop;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@ -170,7 +187,7 @@ in
|
|||||||
|
|
||||||
stylix = {
|
stylix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
image = ../assets/wallpaper.png;
|
image = "${stylix-background}/wallpaper.png";
|
||||||
polarity = "dark";
|
polarity = "dark";
|
||||||
base16Scheme = ../assets/selenized-black.yaml;
|
base16Scheme = ../assets/selenized-black.yaml;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user