My NixOS configuration (mirror)

feat: add tron lock page (#8)

authored by

Matthew Hrehirchuk and committed by
GitHub
a5db70f3 1497d652

+57 -38
+16 -38
home/wayland/hyprlock/default.nix
··· 1 1 { 2 2 config, 3 3 lib, 4 + pkgs, 4 5 ... 5 - }: { 6 + }: let 7 + time = import ./time.nix {inherit pkgs;}; 8 + in { 6 9 options.home.wayland.hyprlock = { 7 10 enable = lib.mkEnableOption "hyprlock configuration"; 8 11 }; ··· 15 18 general = { 16 19 disable_loading_bar = true; 17 20 immediate_render = true; 18 - hide_cursor = false; 21 + hide_cursor = true; 19 22 no_fade_in = true; 20 23 }; 21 24 ··· 26 29 background = [ 27 30 { 28 31 monitor = ""; 29 - path = "~/Pictures/outer-wilds-4k.png"; 30 - blur_passes = 2; 31 - blur_size = 7; 32 - noise = 1.17e-2; # what the fuck??? 32 + path = "color(0x131313)"; 33 33 } 34 34 ]; 35 35 36 36 input-field = [ 37 37 { 38 38 monitor = "eDP-1"; 39 - 40 - size = "300, 50"; 41 - valign = "bottom"; 42 - position = "0%, 10%"; 43 - 44 - outline_thickness = 1; 45 - 46 - font_color = "rgb(248, 248, 242)"; 47 - 48 - outer_color = "rgba(139, 233, 253, 0.5)"; 49 - inner_color = "rgba(80, 250, 123, 0.1)"; 50 - check_color = "rgba(241, 250, 140, 0.5)"; 51 - fail_color = "rgba(255, 85, 85, 0.5)"; 52 - 53 - fade_on_empty = false; 54 - placeholder_text = "Enter Password"; 55 - 56 - dots_spacing = 0.2; 57 - dots_center = true; 58 - dots_fade_time = 100; 59 - 60 - shadow_color = "rgba(0, 0, 0, 0.1)"; 61 - shadow_size = 7; 62 - shadow_passes = 2; 39 + size = "0, 0"; 40 + opacity = 0; 63 41 } 64 42 ]; 65 43 ··· 67 45 { 68 46 monitor = ""; 69 47 text = '' 70 - cmd[update:1000] echo "<span>$(date +'%H:%M:%S')</span>" 48 + cmd[update:10] ${time}/bin/lock-time 71 49 ''; 72 50 font_size = 60; 73 - font_family = "FiraCode Nerd Font"; 51 + font_family = "Departure Mono"; 74 52 75 - color = "rgb(248, 248, 242)"; 53 + color = "rgba(200, 205, 210, 1)"; 76 54 77 - position = "0%, -30%"; 55 + position = "0%, 0%"; 78 56 79 57 valign = "center"; 80 58 halign = "center"; 81 59 82 - shadow_color = "rgba(0, 0, 0, 0.1)"; 83 - shadow_size = 20; 84 - shadow_passes = 2; 85 - shadow_boost = 0.3; 60 + shadow_color = "rgba(100, 200, 220, 0.3)"; 61 + shadow_size = 12; 62 + shadow_passes = 3; 63 + shadow_boost = 0.4; 86 64 } 87 65 ]; 88 66 };
+41
home/wayland/hyprlock/time.nix
··· 1 + {pkgs, ...}: 2 + pkgs.stdenv.mkDerivation { 3 + name = "lock-time"; 4 + 5 + dontUnpack = true; 6 + 7 + buildPhase = '' 8 + cat > lock-time.c << 'EOF' 9 + #include <stdio.h> 10 + #include <time.h> 11 + #include <sys/time.h> 12 + 13 + int main() { 14 + struct timeval tv; 15 + struct tm *tm_info; 16 + 17 + gettimeofday(&tv, NULL); 18 + tm_info = localtime(&tv.tv_sec); 19 + 20 + int centiseconds = tv.tv_usec / 10000; 21 + 22 + printf("<span>%02d:%02d:%02d:%02d:%02d:%02d:%02d</span>\n", 23 + tm_info->tm_year % 100, 24 + tm_info->tm_mon + 1, 25 + tm_info->tm_mday, 26 + tm_info->tm_hour, 27 + tm_info->tm_min, 28 + tm_info->tm_sec, 29 + centiseconds); 30 + 31 + return 0; 32 + } 33 + EOF 34 + $CC -o lock-time lock-time.c 35 + ''; 36 + 37 + installPhase = '' 38 + mkdir -p $out/bin 39 + cp lock-time $out/bin/ 40 + ''; 41 + }