diff --git a/modules/feh/hm.nix b/modules/feh/hm.nix index 3642ec693..62fccb0a7 100644 --- a/modules/feh/hm.nix +++ b/modules/feh/hm.nix @@ -18,6 +18,18 @@ || spectrwm.enable || xmonad.enable ) - ) - "${pkgs.feh}/bin/feh --no-fehbg --bg-scale ${config.stylix.image}"; + ) (let + inherit (config.stylix) imageScalingMode; + 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 "${pkgs.feh}/bin/feh --no-fehbg ${bg-arg} ${config.stylix.image}"); } diff --git a/modules/feh/nixos.nix b/modules/feh/nixos.nix index 2826af181..74f668858 100644 --- a/modules/feh/nixos.nix +++ b/modules/feh/nixos.nix @@ -16,5 +16,18 @@ || i3.enable ) ) - "${pkgs.feh}/bin/feh --no-fehbg --bg-scale ${config.stylix.image}"; + (let + inherit (config.stylix) imageScalingMode; + 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 "${pkgs.feh}/bin/feh --no-fehbg ${bg-arg} ${config.stylix.image}"); }