btop: use mkTarget

This commit is contained in:
awwpotato 2025-05-21 13:52:03 -07:00
parent 81cb57a350
commit 910dc0dc3e
No known key found for this signature in database

View file

@ -1,22 +1,27 @@
{ config, lib, ... }:
{
options.stylix.targets.btop.enable =
config.lib.stylix.mkEnableTarget "btop" true;
mkTarget,
lib,
...
}:
mkTarget {
name = "btop";
humanName = "btop";
config =
lib.mkIf
(
config.stylix.enable
&& config.stylix.targets.btop.enable
&& config.programs.btop.enable
)
configElements = [
(
{ opacity }:
{
programs.btop.settings.theme_background = lib.mkIf (
opacity.terminal != 1.0
) false;
}
)
(
{ colors }:
{
programs.btop = {
settings = {
color_theme = "stylix";
theme_background = lib.mkIf (config.stylix.opacity.terminal != 1.0) false;
};
themes.stylix = with config.lib.stylix.colors.withHashtag; ''
settings.color_theme = "stylix";
themes.stylix = with colors.withHashtag; ''
#Generated by Stylix
theme[main_bg]="${base00}"
theme[main_fg]="${base05}"
@ -62,5 +67,7 @@
theme[process_end]="${base08}"
'';
};
};
}
)
];
}