Optionalize the stylix.image option when stylix.base16Scheme is set,
making the following Stylix configurations valid:
[
// Now it possible to set 'stylix.image = null', if
// stylix.base16Scheme is set.
{
base16Scheme = /* ... */;
}
// This configuration was already possible.
{
image = /* ... */;
}
// This configuration was already possible.
{
base16Scheme = /* ... */;
image = /* ... */;
}
]
Closes: https://github.com/danth/stylix/issues/200
Closes: https://github.com/danth/stylix/issues/442
Link: https://github.com/danth/stylix/pull/717
Co-authored-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Tested-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Reviewed-by: Daniel Thwaites <danth@danth.me>
49 lines
1.1 KiB
Nix
49 lines
1.1 KiB
Nix
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.stylix.targets.feh;
|
|
in
|
|
{
|
|
options.stylix.targets.feh = {
|
|
enable = config.lib.stylix.mkEnableTarget "the desktop background using Feh" (
|
|
config.stylix.image != null
|
|
);
|
|
};
|
|
|
|
config.xsession.initExtra =
|
|
lib.mkIf
|
|
(
|
|
config.stylix.enable
|
|
&& cfg.enable
|
|
&& (
|
|
with config.xsession.windowManager;
|
|
bspwm.enable
|
|
|| herbstluftwm.enable
|
|
|| i3.enable
|
|
|| spectrwm.enable
|
|
|| xmonad.enable
|
|
)
|
|
)
|
|
(
|
|
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}"
|
|
);
|
|
}
|