Link: https://github.com/nix-community/stylix/pull/1371 Reviewed-by: pancho horrillo <pancho@pancho.name> Reviewed-by: Matt Sturgeon <matt@sturgeon.me.uk> Co-authored-by: NAHO <90870942+trueNAHO@users.noreply.github.com> Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
35 lines
826 B
Nix
35 lines
826 B
Nix
{
|
|
mkTarget,
|
|
lib,
|
|
pkgs,
|
|
config,
|
|
...
|
|
}:
|
|
mkTarget {
|
|
name = "feh";
|
|
humanName = "the desktop background using Feh";
|
|
autoEnable =
|
|
with config.services.xserver.windowManager;
|
|
xmonad.enable || i3.enable;
|
|
|
|
configElements =
|
|
{ image, imageScalingMode }:
|
|
{
|
|
services.xserver.displayManager.sessionCommands =
|
|
let
|
|
bg-arg =
|
|
if imageScalingMode == "fill" then
|
|
"--bg-fill"
|
|
else if imageScalingMode == "center" then
|
|
"--bg-center"
|
|
else if imageScalingMode == "tile" then
|
|
"--bg-tile"
|
|
else if imageScalingMode == "stretch" then
|
|
"--bg-scale"
|
|
# Fit
|
|
else
|
|
"--bg-max";
|
|
in
|
|
"${lib.getExe pkgs.feh} --no-fehbg ${bg-arg} ${image}";
|
|
};
|
|
}
|