refactor: move hyprlock settings to nix

This commit is contained in:
DACHXY 2025-04-28 03:06:00 +08:00
parent 8772b124fa
commit d298d751fc
3 changed files with 124 additions and 110 deletions

View file

@ -108,21 +108,128 @@ in
"source"
];
extraConfig =
builtins.readFile ../config/hypr/hyprlock.conf
+ ''
# CURRENT SONG
label {
monitor =
text = cmd[update:1000] echo "$(${getCurrentSong}/bin/getSong)"
color = rgba(235, 219, 178, .75)
font_size = 16
font_family = $font, $font2
position = 0, 80
halign = center
valign = bottom
}
'';
settings =
let
font = "CaskaydiaCove Nerd Font";
font2 = "SF Pro Display Bold";
mainMonitor =
if ((builtins.length settings.hyprland.monitors) > 0) then
# TODO: Identifying monitor by desc is broken
# https://github.com/hyprwm/hyprlock/issues/737
# builtins.elemAt settings.hyprland.monitors 0
"DP-2"
else
"";
in
{
background = {
monitor = "";
path = "screenshot";
blur_passes = 3;
blur_size = 8;
contrast = 0.8916;
brightness = 0.8172;
vibrancy = 0.1696;
vibrancy_darkness = 0.0;
};
# GENERAL
general = {
no_fade_in = false;
grace = 0;
disable_loading_bar = false;
ignore_empty_input = true;
fail_timeout = 1000;
};
# TIME
label = [
{
monitor = "${mainMonitor}";
text = ''cmd[update:1000] echo "$(date +"%-I:%M%p")"'';
color = "rgba(250, 189, 47, .75)";
font_size = 120;
font_family = "${font2}";
position = "0, -140";
halign = "center";
valign = "top";
}
# DAY-DATE-MONTH
{
monitor = "${mainMonitor}";
text = ''cmd[update:1000] echo "<span>$(date '+%A, %d %B')</span>"'';
color = "rgba(225, 225, 225, 0.75)";
font_size = 30;
font_family = "${font2}";
position = "0, 200";
halign = "center";
valign = "center";
}
# USER
{
monitor = "${mainMonitor}";
text = "Hello, $USER";
color = "rgba(255, 255, 255, .65)";
font_size = 25;
font_family = "${font2}";
position = "0, -70";
halign = "center";
valign = "center";
}
# Current Song
{
monitor = "${mainMonitor}";
text = ''cmd[update:1000] echo "$(${getCurrentSong}/bin/getSong)"'';
color = "rgba(235, 219, 178, .75)";
font_size = 16;
font_family = "${font}, ${font2}";
position = "0, 80";
halign = "center";
valign = "bottom";
}
];
# LOGO
image = {
monitor = "${mainMonitor}";
path = "$HOME/.face";
border_size = 2;
border_color = "rgba(255, 255, 255, .75)";
size = 95;
rounding = -1;
rotate = 0;
reload_time = -1;
reload_cmd = "";
position = "0, 60";
halign = "center";
valign = "center";
};
# INPUT FIELD
input-field = [
{
monitor = "${mainMonitor}";
size = "290, 60";
outline_thickness = 2;
dots_size = 0.2; # Scale of input-field height, 0.2 - 0.8
dots_spacing = 0.2; # Scale of dots' absolute size, 0.0 - 1.0
dots_center = true;
outer_color = "rgba(0, 0, 0, 0)";
inner_color = "rgba(60, 56, 54, 0.35)";
font_color = "rgb(200, 200, 200)";
fail_color = "rgba(218, 53, 50, 0.56)";
fade_on_empty = false;
font_family = "${font2}";
placeholder_text = ''<i><span foreground="##ffffff99">Bruh, come back!</span></i>'';
hide_input = false;
position = "0, -140";
halign = "center";
valign = "center";
}
];
};
};
# === hypridle === #