11.stylix/modules/wayfire/hm.nix
NAHO a950a3f529
wayfire: remove optional toString (#1658)
Link: https://github.com/nix-community/stylix/pull/1658

Reviewed-by: 1444 <54070204+0x5a4@users.noreply.github.com>
Tested-by: 1444 <54070204+0x5a4@users.noreply.github.com>
2025-07-13 17:04:40 +02:00

91 lines
2.2 KiB
Nix

{
mkTarget,
config,
lib,
pkgs,
...
}:
mkTarget {
name = "wayfire";
humanName = "Wayfire";
extraOptions.useWallpaper = config.lib.stylix.mkEnableWallpaper "wayfire" true;
configElements = [
(
{ fonts }:
{
wayland.windowManager.wayfire.settings.decoration.font =
"${fonts.monospace.name} ${toString fonts.sizes.desktop}";
}
)
(
{
cfg,
image,
imageScalingMode,
}:
let
wayfireBackground = pkgs.runCommand "wayfire-background.png" { } ''
${lib.getExe' pkgs.imagemagick "convert"} ${image} $out
'';
in
{
wayland.windowManager.wayfire.settings = {
cube = {
cubemap_image = lib.mkIf cfg.useWallpaper wayfireBackground;
skydome_texture = lib.mkIf cfg.useWallpaper wayfireBackground;
};
};
wayland.windowManager.wayfire.wf-shell.settings = {
background.image = lib.mkIf cfg.useWallpaper wayfireBackground;
background.fill_mode =
if imageScalingMode == "stretch" then
"stretch"
else if imageScalingMode == "fit" then
"preserve_aspect"
else
"fill_and_crop";
};
}
)
(
{ targets }:
{
wayland.windowManager.wayfire.wf-shell.settings.panel.menu_icon =
lib.mkIf targets.nixos-icons.enable "${pkgs.nixos-icons}/share/icons/hicolor/256x256/apps/nix-snowflake.png";
}
)
(
{ colors }:
let
rgba = rgb: a: "\\#${rgb}${a}";
rgb = (lib.flip rgba) "ff";
in
{
wayland.windowManager.wayfire = {
settings = {
cube = {
background = rgb colors.base00;
};
expo.background = rgb colors.base00;
vswitch.background = rgb colors.base00;
vswipe.background = rgb colors.base00;
core.background_color = rgb colors.base00;
decoration = {
active_color = rgb colors.base0D;
inactive_color = rgb colors.base03;
};
};
wf-shell.settings = {
panel.background_color = rgb colors.base01;
};
};
}
)
];
}