From 2fceecd19d2c627f456290382e7b514698a55bc9 Mon Sep 17 00:00:00 2001 From: Aleksandr Lebedev Date: Fri, 29 Nov 2024 10:19:43 +0100 Subject: [PATCH] Added time, keyboard layout and user name widgets to hyprlock --- nixos/hyprland/hyprlock.nix | 125 ++++++++++++++++++++---------------- 1 file changed, 71 insertions(+), 54 deletions(-) diff --git a/nixos/hyprland/hyprlock.nix b/nixos/hyprland/hyprlock.nix index d89cf19..1176786 100644 --- a/nixos/hyprland/hyprlock.nix +++ b/nixos/hyprland/hyprlock.nix @@ -1,57 +1,74 @@ { pkgs, lib, ... }: { - programs.hyprlock = { - enable = true; - settings = { - general = { - enable_fingerprint = true; - }; -background = { - #path = ; - #color = "rgba(25, 20, 20, 1.0)"; - - # all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations - blur_passes = 1; # 0 disables blurring - blur_size = 7; - noise = 0.0117; - contrast = 0.8916; - brightness = 0.8172; - vibrancy = 0.1696; - vibrancy_darkness = 0.0; -}; -input-field = { - size = "600, 100"; - outline_thickness = 3; - dots_size = 0.33; # Scale of input-field height, 0.2 - 0.8 - dots_spacing = 0.15; # Scale of dots' absolute size, -1.0 - 1.0 - dots_center = false; - dots_rounding = -1; # -1 default circle, -2 follow input-field rounding - dots_fade_time = 200; # Milliseconds until a dot fully fades in - dots_text_format = "";# Text character used for the input indicator. Leave empty for a rectangle that will be rounded via dots_rounding (default). - #outer_color = "rgb(151515)"; - #inner_color = "rgb(200, 200, 200)"; - #font_color = "rgb(10, 10, 10)"; - #font_family = "Noto Sans"; # Font used for placeholder_text, fail_text and dots_text_format. - fade_on_empty = false; - fade_timeout = 1000; # Milliseconds before fade_on_empty is triggered. - placeholder_text = "Input Password..."; # Text rendered in the input box when it's empty. - hide_input = false; - rounding = -1; # -1 means complete rounding (circle/oval) - #check_color = "rgb(204, 136, 34)"; - #fail_color = "rgb(204, 34, 34)"; # if authentication failed, changes outer_color and fail message color - fail_text = "$FAIL ($ATTEMPTS)"; # can be set to empty - fail_timeout = 2000; # milliseconds before fail_text and fail_color disappears - fail_transition = 300; # transition time in ms between normal outer_color and fail_color - capslock_color = -1; - numlock_color = -1; - bothlock_color = -1; # when both locks are active. -1 means don't change outer color (same for above) - invert_numlock = false; # change color if numlock is off - swap_font_color = false; # see below - - position = "0, -20"; - halign = "center"; - valign = "center"; -}; -}; - }; + programs.hyprlock = { + enable = true; + settings = { + general = { + enable_fingerprint = true; + }; + background = { + blur_passes = 1; + blur_size = 7; + noise = 0.0117; + contrast = 0.8916; + brightness = 0.8172; + vibrancy = 0.1696; + vibrancy_darkness = 0.0; + }; + input-field = { + size = "600, 100"; + outline_thickness = 3; + dots_size = 0.33; + dots_spacing = 0.15; + dots_center = false; + dots_rounding = -1; + dots_fade_time = 200; + placeholder_text = "Input Password..."; + hide_input = false; + fade_on_empty = false; + fail_text = "$FAIL ($ATTEMPTS)"; + fail_timeout = 2000; + fail_transition = 300; + position = "0, -20"; + halign = "center"; + valign = "center"; + }; + label = [ + { + text = "$USER"; + font_family = "Fira Code"; + font_size = 56; + font_color = "rgb(255, 255, 255)"; + shadow_color = "rgba(0, 0, 0, 0.5)"; + shadow_offset = "2, 2"; + position = "0, 100"; + halign = "center"; + valign = "center"; + } + { + text = "$TIME"; + font_family = "Roboto"; + font_size = 72; + font_color = "rgb(255, 255, 255)"; + shadow_color = "rgba(0, 0, 0, 0.7)"; + shadow_offset = "3, 3"; + position = "-40, -40"; + halign = "right"; + valign = "top"; + } + { + text = "$LAYOUT"; + font_family = "JetBrains Mono"; + font_size = 28; + font_color = "rgb(200, 200, 200)"; + shadow_color = "rgba(0, 0, 0, 0.5)"; + shadow_offset = "1, 1"; + position = "-20, 20"; + halign = "right"; + valign = "bottom"; + } + ]; + }; + }; } +