Link: https://github.com/nix-community/stylix/pull/1659 Tested-by: NAHO <90870942+trueNAHO@users.noreply.github.com> Reviewed-by: awwpotato <awwpotato@voidq.com>
32 lines
838 B
Nix
32 lines
838 B
Nix
{ mkTarget, lib, ... }:
|
|
mkTarget {
|
|
name = "wpaperd";
|
|
humanName = "wpaperd";
|
|
|
|
configElements =
|
|
{ imageScalingMode, image }:
|
|
(
|
|
let
|
|
# wpaperd doesn't have any mode close to the described behavior of center
|
|
modeMap = {
|
|
"stretch" = "stretch";
|
|
# wpaperd's center mode is closest to the described behavior of fill
|
|
"fill" = "center";
|
|
"fit" = "fit";
|
|
"tile" = "tile";
|
|
};
|
|
|
|
modeAttrs =
|
|
if builtins.hasAttr imageScalingMode modeMap then
|
|
{ mode = modeMap.${imageScalingMode}; }
|
|
else
|
|
lib.info "stylix: wpaperd: unsupported image scaling mode: ${imageScalingMode}"
|
|
{ };
|
|
in
|
|
{
|
|
services.wpaperd.settings.any = {
|
|
path = image;
|
|
} // modeAttrs;
|
|
}
|
|
);
|
|
}
|