{ config, pkgs, myConfig, ... }: let cacheWallpaper = "${config.home.homeDirectory}/.cache/current_wallpaper"; clockFont = myConfig.font.monospace; scriptFont = myConfig.font.monospaceScript; greetingConf = "${config.home.homeDirectory}/.cache/hyprlock-greeting.conf"; hakase-hyprlock = pkgs.writeShellScriptBin "hakase-hyprlock" '' # Get focused monitor monitor=$(hyprctl monitors -j | ${pkgs.jq}/bin/jq -r '.[] | select(.focused) | .name') # Generate greeting label config cat > ${greetingConf} << EOF label { monitor = $monitor text = cmd[update:200] hakase-hyprlock-typewriter "\$(hakase-hyprlock-text-generator)" color = \$on_surface_variant font_size = 120 font_family = ${clockFont} Bold position = 0, 480 halign = center valign = center } EOF exec hyprlock "$@" ''; in { imports = [ ./scripts/typewriter.nix ./scripts/random-text.nix ]; home.packages = [hakase-hyprlock]; programs.hyprlock = { enable = true; extraConfig = '' source = ~/.config/hypr/hyprlock-colors.conf source = ${greetingConf} general { hide_cursor = true grace = 0 } background { monitor = path = ${cacheWallpaper} blur_passes = 3 blur_size = 8 contrast = 0.9 brightness = 0.7 vibrancy = 0.2 } # Hours (top) label { monitor = text = cmd[update:1000] date +%H color = $on_surface font_size = 140 font_family = ${clockFont} Bold position = 0, 80 halign = center valign = center } # Minutes (bottom) label { monitor = text = cmd[update:1000] date +%M color = $primary font_size = 140 font_family = ${clockFont} Bold position = 0, -80 halign = center valign = center } # Date label { monitor = text = cmd[update:60000] echo "$(date '+%A, %B %d')" color = $on_surface_variant font_size = 18 font_family = ${clockFont} Italic position = 0, -320 halign = center valign = center } # Caps Lock indicator (above input) label { monitor = text = cmd[update:100] cat /sys/class/leds/*capslock*/brightness 2>/dev/null | grep -q 1 && echo 'CAPS LOCK' color = $tertiary font_size = 12 font_family = ${clockFont} position = 0, -210 halign = center valign = center } input-field { monitor = size = 300, 50 outline_thickness = 3 dots_size = 0.33 dots_spacing = 0.15 dots_center = true outer_color = $primary inner_color = $surface font_color = $on_surface fade_on_empty = false placeholder_text = Password... hide_input = false rounding = 15 position = 0, -250 halign = center valign = center # Auth feedback check_color = $secondary fail_color = $error fail_text = $FAIL ($ATTEMPTS) fail_timeout = 2000 fail_transition = 300 } ''; }; }