treewide: move hyprlock styling out of module

This commit is contained in:
Anthony Rodriguez 2025-01-17 12:02:58 +01:00
parent 0fe6f67b20
commit a315915298
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
2 changed files with 101 additions and 110 deletions

View file

@ -1,14 +1,114 @@
{ {
lib, lib,
lib',
inputs, inputs,
pkgs, pkgs,
osConfig, osConfig,
... ...
}: { }: let
styleCfg = osConfig.local.style;
rgbaPalette = builtins.mapAttrs (_: c: (lib'.rgba c 1)) styleCfg.scheme.palette;
in {
config = lib.mkIf osConfig.local.modules.hyprland.enable { config = lib.mkIf osConfig.local.modules.hyprland.enable {
programs.hyprlock = { programs.hyprlock = {
enable = true; enable = true;
package = inputs.hyprlock.packages.${pkgs.system}.hyprlock; package = inputs.hyprlock.packages.${pkgs.system}.hyprlock;
settings = lib.mkMerge [
{
general = {
disable_loading_bar = true;
hide_cursor = true;
};
}
(with rgbaPalette;
lib.mkIf styleCfg.enable {
background = [
{
path = "screenshot";
blur_passes = 3;
blur_size = 8;
}
];
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 = "";
path = "${styleCfg.avatar}"; # Replace with your avatar path
size = 100;
border_color = 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 = 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=\"#${styleCfg.scheme.palette.base05}\"><i>󰌾 Logged in as </i><span foreground=\"#${styleCfg.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

@ -1,109 +0,0 @@
{
lib,
lib',
config,
...
}: let
cfg = config.local.style;
# 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 = 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;
};
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 = "";
path = "${cfg.avatar}"; # Replace with your avatar path
size = 100;
border_color = 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 = 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.base05}\"><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";
}
];
};
};
}
];
}