From 415fbdd7954ee8bb50ebda65a453131b9cdecace Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 4 Mar 2024 13:35:26 +0000 Subject: [PATCH] Swap swaylock for hyprlock Add hyprlock config file based on https://github.com/NikSneMC/hyprlock --- home/hyprland/default.nix | 85 ++++++++++++++++++++++++++++++++++++--- system/hyprland.nix | 5 +-- 2 files changed, 80 insertions(+), 10 deletions(-) diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index 7b44e875..f09bffc8 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -11,7 +11,6 @@ ../default.nix ../email/default.nix ../password-store/default.nix - ../swaylock/default.nix ../waybar/default.nix ../rofi/default.nix ../swaync/default.nix @@ -67,10 +66,6 @@ name = "Catppuccin-${catppuccinVariant}-${size}-${accent}-Dark"; }; }; - xdg.configFile."hypr/hyprpaper.conf".text = '' - preload = ${config.stylix.image} - wallpaper = ,${config.stylix.image} - ''; systemd.user.services.hyprpaper = { Unit = { Description = "Hyprland wallpaper utility"; @@ -259,7 +254,7 @@ btm_args = "--autohide_time --battery --celsius --enable_cache_memory --enable_gpu_memory --group --hide_avg_cpu --hide_table_gap --retention=3m --show_table_scroll_position"; in [ # See https://wiki.hyprland.org/Configuring/Keywords/ for more - "SUPER, F1, exec, ${swaylock.package}/bin/swaylock --screenshots --clock --indicator --grace-no-mouse" + "SUPER, F1, exec, ${pkgs.hyprlock}/bin/hyprlock" "SUPER, Q, killactive," "SUPER SHIFT, Q, exec, pkill rofi || ${rofi.finalPackage}/bin/rofi -show powermenu -modi powermenu:${pkgs.rofi-power-menu}/bin/rofi-power-menu" "SUPER, V, togglefloating" @@ -355,4 +350,82 @@ exec-once = ${pkgs.git}/bin/git -C ${config.xdg.configHome}/emacs pull --ff-only ''; }; + xdg.configFile = { + "hypr/hyprpaper.conf".text = '' + preload = ${config.stylix.image} + wallpaper = ,${config.stylix.image} + ''; + "hypr/hyprlock.conf".text = with config.lib.stylix.colors; let + font = config.stylix.fonts.sansSerif.name; + accent = config.lib.stylix.colors.${accentColour}; + in '' + # GENERAL + general { + disable_loading_bar = true + } + + # BACKGROUND + background { + monitor = + path = screenshot + blur_passes = 3 + color = 0xff${base00} + } + + # TIME + label { + monitor = + text = cmd[update:30000] echo "$(date +"%R")" + color = 0xff${base05} + font_size = 90 + font_family = ${font} + position = -30, 0 + halign = right + valign = top + } + + # DATE + label { + monitor = + text = cmd[update:43200000] echo "$(date +"%A,%e %B %Y")" + color = 0xff${base05} + font_size = 25 + font_family = ${font} + position = -30, -150 + halign = right + valign = top + } + + # USER + label { + monitor = + text = Logging in as $USER + color = 0xff${base05} + font_size = 25 + font_family = ${font} + position = 0, 50 + halign = center + valign = center + } + + # INPUT FIELD + input-field { + monitor = + size = 300, 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 = 0xff${accent} + inner_color = 0xff${base00} + font_color = 0xff${base05} + fade_on_empty = false + placeholder_text = Input Password... + hide_input = false + position = 0, -50 + halign = center + valign = center + } + ''; + }; } diff --git a/system/hyprland.nix b/system/hyprland.nix index 6a0fda5e..c8f14aa1 100644 --- a/system/hyprland.nix +++ b/system/hyprland.nix @@ -28,10 +28,7 @@ streamlink ]; }; - security.pam.services = { - swaylock = {}; - hyprlock = {}; - }; + security.pam.services.hyprlock = {}; services = { xserver.enable = false; blueman.enable = true;