mirror of
https://github.com/youwen5/liminalOS.git
synced 2025-06-20 05:59:51 -07:00
feat: tint the fastfetch image with system colors for consistency
This commit is contained in:
parent
19812d4514
commit
3c3d13f3a9
1 changed files with 40 additions and 16 deletions
|
@ -1,4 +1,10 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
osConfig,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
fastfetchConfig = builtins.fromJSON (builtins.readFile ./config.json);
|
||||
cfg = config.liminalOS.shellEnv.fastfetch;
|
||||
|
@ -19,21 +25,39 @@ in
|
|||
Whether to use the kitty image protocol.
|
||||
'';
|
||||
};
|
||||
tintImage = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = osConfig.liminalOS.theming.enable;
|
||||
description = ''
|
||||
Whether to tint the image with system wide colors.
|
||||
'';
|
||||
};
|
||||
};
|
||||
config.programs.fastfetch = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
settings = (
|
||||
fastfetchConfig
|
||||
// {
|
||||
logo = {
|
||||
height = 18;
|
||||
padding = {
|
||||
top = 2;
|
||||
config.programs.fastfetch =
|
||||
let
|
||||
image =
|
||||
if !cfg.tintImage then
|
||||
./nixos-logo.png
|
||||
else
|
||||
pkgs.runCommand "nixos-logo.png" { } ''
|
||||
COLOR="#${config.lib.stylix.colors.base0A}"
|
||||
${lib.getExe pkgs.imagemagick} ${./nixos-logo.png} -size 512x512 -fill $COLOR -tint 50 $out
|
||||
'';
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
settings = (
|
||||
fastfetchConfig
|
||||
// {
|
||||
logo = {
|
||||
height = 18;
|
||||
padding = {
|
||||
top = 2;
|
||||
};
|
||||
type = if cfg.useKittyImage then "kitty" else "auto";
|
||||
source = lib.mkIf cfg.useKittyImage image;
|
||||
};
|
||||
type = if cfg.useKittyImage then "kitty" else "auto";
|
||||
source = lib.mkIf cfg.useKittyImage ./nixos-logo.png;
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue