nixosModules/style: use with cfg.scheme.palette; when declaring colors

This commit is contained in:
Anthony Rodriguez 2024-12-20 09:20:19 +01:00
parent ec2bce3b55
commit 9f0cdf9f98
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
7 changed files with 181 additions and 178 deletions

View file

@ -4,11 +4,10 @@
...
}: let
cfg = config.local.style;
inherit (cfg) scheme;
in {
config.home-manager.sharedModules = lib.mkIf cfg.enable [
{
xdg.configFile."equibop/themes/midnight-base16.css".text = with scheme.palette; ''
xdg.configFile."equibop/themes/midnight-base16.css".text = with cfg.scheme.palette; ''
/**
* @name Midnight-base16
* @description A dark, rounded discord theme. Updated to use base16 colors.
@ -31,7 +30,7 @@ in {
--font: 'gg sans';
/* top left corner text */
--corner-text: '${scheme.name}';
--corner-text: '${cfg.scheme.name}';
/* color of status indicators and window controls */
--online-indicator: ${base0B}; /* change to #23a55a for default green */

View file

@ -10,35 +10,36 @@ in {
programs.foot.settings.colors = let
# because someone thought this was a great idea: https://github.com/tinted-theming/schemes/commit/61058a8d2e2bd4482b53d57a68feb56cdb991f0b
palette = builtins.mapAttrs (_: color: lib.removePrefix "#" color) cfg.scheme.palette;
in {
background = palette.base00;
foreground = palette.base05;
in
with palette; {
background = base00;
foreground = base05;
regular0 = palette.base00;
regular1 = palette.base08;
regular2 = palette.base0B;
regular3 = palette.base0A;
regular4 = palette.base0D;
regular5 = palette.base0E;
regular6 = palette.base0C;
regular7 = palette.base05;
regular0 = base00;
regular1 = base08;
regular2 = base0B;
regular3 = base0A;
regular4 = base0D;
regular5 = base0E;
regular6 = base0C;
regular7 = base05;
bright0 = palette.base02;
bright1 = palette.base08;
bright2 = palette.base0B;
bright3 = palette.base0A;
bright4 = palette.base0D;
bright5 = palette.base0E;
bright6 = palette.base0C;
bright7 = palette.base07;
bright0 = base02;
bright1 = base08;
bright2 = base0B;
bright3 = base0A;
bright4 = base0D;
bright5 = base0E;
bright6 = base0C;
bright7 = base07;
"16" = palette.base09;
"17" = palette.base0F;
"18" = palette.base01;
"19" = palette.base02;
"20" = palette.base04;
"21" = palette.base06;
};
"16" = base09;
"17" = base0F;
"18" = base01;
"19" = base02;
"20" = base04;
"21" = base06;
};
}
];
}

View file

@ -12,14 +12,14 @@ in {
main = {
font = "sans-serif:size=16";
};
colors = {
background = "${scheme.palette.base01}f2";
text = "${scheme.palette.base05}ff";
match = "${scheme.palette.base0E}ff";
selection = "${scheme.palette.base03}ff";
selection-text = "${scheme.palette.base06}ff";
selection-match = "${scheme.palette.base0E}ff";
border = "${scheme.palette.base0E}ff";
colors = with scheme.palette; {
background = "${base01}f2";
text = "${base05}ff";
match = "${base0E}ff";
selection = "${base03}ff";
selection-text = "${base06}ff";
selection-match = "${base0E}ff";
border = "${base0E}ff";
};
};
}

View file

@ -1,7 +1,6 @@
{
lib,
config,
scheme,
...
}: let
cfg = config.local.style;

View file

@ -5,101 +5,105 @@
...
}: let
cfg = config.local.style;
inherit (cfg) scheme;
rgbaPalette = builtins.mapAttrs (_: c: (lib'.rgba c 1)) scheme.palette;
# hyprlock takes colors such as rgb[a](r, g, b [, a])
rgbaPalette = builtins.mapAttrs (_: c: (lib'.rgba c 1)) cfg.scheme.palette;
in {
config.home-manager.sharedModules = lib.mkIf cfg.enable [
{
programs.hyprlock = {
settings = {
background = [
{
path = "screenshot";
blur_passes = 3;
blur_size = 8;
}
];
config.home-manager.sharedModules = with rgbaPalette;
lib.mkIf cfg.enable [
{
programs.hyprlock = {
settings = {
background = [
{
path = "screenshot";
blur_passes = 3;
blur_size = 8;
}
];
general = {
disable_loading_bar = true;
hide_cursor = true;
};
general = {
disable_loading_bar = true;
hide_cursor = true;
};
label = [
{
label = [
{
monitor = "";
text = "Layout: $LAYOUT";
font_size = 25;
color = base05;
position = "30, -30";
halign = "left";
valign = "top";
}
{
monitor = "";
text = "$TIME";
font_size = 90;
color = base05;
position = "-30, 0";
halign = "right";
valign = "top";
}
{
monitor = "";
text = "cmd[update:43200000] date +\"%A, %d %B %Y\"";
font_size = 25;
color = base05;
position = "-30, -150";
halign = "right";
valign = "top";
}
];
image = {
monitor = "";
text = "Layout: $LAYOUT";
font_size = 25;
color = rgbaPalette.base05;
path = "${cfg.avatar}"; # Replace with your avatar path
size = 100;
border_color = base0D;
position = "30, -30";
halign = "left";
valign = "top";
}
{
monitor = "";
text = "$TIME";
font_size = 90;
color = rgbaPalette.base05;
position = "-30, 0";
halign = "right";
valign = "top";
}
{
monitor = "";
text = "cmd[update:43200000] date +\"%A, %d %B %Y\"";
font_size = 25;
color = rgbaPalette.base05;
position = "-30, -150";
halign = "right";
valign = "top";
}
];
image = {
monitor = "";
path = "${cfg.avatar}"; # Replace with your avatar path
size = 100;
border_color = rgbaPalette.base0D;
position = "0, 75";
halign = "center";
valign = "center";
};
input-field = [
{
monitor = "";
size = "300, 60";
outline_thickness = 4;
dots_size = 0.2;
dots_spacing = 0.2;
dots_center = true;
outer_color = rgbaPalette.base0D;
inner_color = rgbaPalette.base02;
font_color = rgbaPalette.base05;
fade_on_empty = false;
placeholder_text = "<span foreground=\"#${scheme.palette.base03}\"><i>󰌾 Logged in as </i><span foreground=\"#${scheme.palette.base0D}\">$USER</span></span>";
hide_input = false;
check_color = rgbaPalette.base0D;
fail_color = rgbaPalette.base08;
fail_text = "<i>$FAIL <b>($ATTEMPTS)</b></i>";
capslock_color = rgbaPalette.base0E;
position = "0, -47";
position = "0, 75";
halign = "center";
valign = "center";
}
];
};
input-field = [
{
monitor = "";
size = "300, 60";
outline_thickness = 4;
dots_size = 0.2;
dots_spacing = 0.2;
dots_center = true;
outer_color = base0D;
inner_color = base02;
font_color = base05;
fade_on_empty = false;
# the span elements still use #RRGGBB, so we use scheme directly
placeholder_text = "<span foreground=\"#${cfg.scheme.palette.base03}\"><i>󰌾 Logged in as </i><span foreground=\"#${cfg.scheme.palette.base0D}\">$USER</span></span>";
hide_input = false;
check_color = base0D;
fail_color = base08;
fail_text = "<i>$FAIL <b>($ATTEMPTS)</b></i>";
capslock_color = base0E;
position = "0, -47";
halign = "center";
valign = "center";
}
];
};
};
};
}
];
}
];
}

View file

@ -4,44 +4,44 @@
...
}: let
cfg = config.local.style;
inherit (cfg) scheme;
in {
config.home-manager.sharedModules = lib.mkIf cfg.enable [
{
programs.swaylock.settings = {
inside-color = scheme.palette.base01;
line-color = scheme.palette.base01;
ring-color = scheme.palette.base05;
text-color = scheme.palette.base05;
config.home-manager.sharedModules = with cfg.scheme.palette;
lib.mkIf cfg.enable [
{
programs.swaylock.settings = {
inside-color = base01;
line-color = base01;
ring-color = base05;
text-color = base05;
inside-clear-color = scheme.palette.base0A;
line-clear-color = scheme.palette.base0A;
ring-clear-color = scheme.palette.base00;
text-clear-color = scheme.palette.base00;
inside-clear-color = base0A;
line-clear-color = base0A;
ring-clear-color = base00;
text-clear-color = base00;
inside-caps-lock-color = scheme.palette.base03;
line-caps-lock-color = scheme.palette.base03;
ring-caps-lock-color = scheme.palette.base00;
text-caps-lock-color = scheme.palette.base00;
inside-caps-lock-color = base03;
line-caps-lock-color = base03;
ring-caps-lock-color = base00;
text-caps-lock-color = base00;
inside-ver-color = scheme.palette.base0D;
line-ver-color = scheme.palette.base0D;
ring-ver-color = scheme.palette.base00;
text-ver-color = scheme.palette.base00;
inside-ver-color = base0D;
line-ver-color = base0D;
ring-ver-color = base00;
text-ver-color = base00;
inside-wrong-color = scheme.palette.base08;
line-wrong-color = scheme.palette.base08;
ring-wrong-color = scheme.palette.base00;
text-wrong-color = scheme.palette.base00;
inside-wrong-color = base08;
line-wrong-color = base08;
ring-wrong-color = base00;
text-wrong-color = base00;
caps-lock-bs-hl-color = scheme.palette.base08;
caps-lock-key-hl-color = scheme.palette.base0D;
bs-hl-color = scheme.palette.base08;
key-hl-color = scheme.palette.base0D;
caps-lock-bs-hl-color = base08;
caps-lock-key-hl-color = base0D;
bs-hl-color = base08;
key-hl-color = base0D;
separator-color = "#00000000"; # transparent
layout-bg-color = "#00000050"; # semi-transparent black
};
}
];
separator-color = "#00000000"; # transparent
layout-bg-color = "#00000050"; # semi-transparent black
};
}
];
}

View file

@ -8,7 +8,7 @@
in {
config.home-manager.sharedModules = lib.mkIf cfg.enable [
{
programs.waybar.style = ''
programs.waybar.style = with cfg.scheme.palette; ''
* {
font-family: "0xProto Nerd Font";
font-size: 16px;
@ -20,8 +20,8 @@ in {
background: rgba(0,0,0,0);
}
#workspaces {
color: ${cfg.scheme.palette.base00};
background: ${cfg.scheme.palette.base01};
color: ${base00};
background: ${base01};
margin: 4px 4px;
padding: 5px 5px;
border-radius: 16px;
@ -31,8 +31,8 @@ in {
padding: 0px 5px;
margin: 0px 3px;
border-radius: 16px;
color: ${cfg.scheme.palette.base00};
background: linear-gradient(45deg, ${cfg.scheme.palette.base08}, ${cfg.scheme.palette.base0D});
color: ${base00};
background: linear-gradient(45deg, ${base08}, ${base0D});
opacity: 0.5;
transition: ${betterTransition};
}
@ -41,8 +41,8 @@ in {
padding: 0px 5px;
margin: 0px 3px;
border-radius: 16px;
color: ${cfg.scheme.palette.base00};
background: linear-gradient(45deg, ${cfg.scheme.palette.base08}, ${cfg.scheme.palette.base0D});
color: ${base00};
background: linear-gradient(45deg, ${base08}, ${base0D});
transition: ${betterTransition};
opacity: 1.0;
min-width: 40px;
@ -50,33 +50,33 @@ in {
#workspaces button:hover {
font-weight: bold;
border-radius: 16px;
color: ${cfg.scheme.palette.base00};
background: linear-gradient(45deg, ${cfg.scheme.palette.base08}, ${cfg.scheme.palette.base0D});
color: ${base00};
background: linear-gradient(45deg, ${base08}, ${base0D});
opacity: 0.8;
transition: ${betterTransition};
}
tooltip {
background: ${cfg.scheme.palette.base00};
border: 1px solid ${cfg.scheme.palette.base08};
background: ${base00};
border: 1px solid ${base08};
border-radius: 12px;
}
tooltip label {
color: ${cfg.scheme.palette.base08};
color: ${base08};
}
#window, #pulseaudio, #cpu, #memory, #idle_inhibitor {
font-weight: bold;
margin: 4px 0px;
margin-left: 7px;
padding: 0px 18px;
background: ${cfg.scheme.palette.base00};
color: ${cfg.scheme.palette.base05};
background: ${base00};
color: ${base05};
border-radius: 24px 10px 24px 10px;
}
#network, #battery,
#custom-swaync, #tray, #custom-power {
font-weight: bold;
background: ${cfg.scheme.palette.base00};
color: ${cfg.scheme.palette.base05};
background: ${base00};
color: ${base05};
margin: 4px 0px;
margin-right: 7px;
border-radius: 10px 24px 10px 24px;
@ -84,8 +84,8 @@ in {
}
#clock {
font-weight: bold;
color: ${cfg.scheme.palette.base00};
background: linear-gradient(90deg, ${cfg.scheme.palette.base0E}, ${cfg.scheme.palette.base0C});
color: ${base00};
background: linear-gradient(90deg, ${base0E}, ${base0C});
margin: 0px;
padding: 0px 15px 0px 30px;
border-radius: 0px 0px 0px 40px;