From 9cf4756ab05ab107012d9a80eca3fefc0f44d174 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Wed, 24 Apr 2024 08:23:36 -0500 Subject: [PATCH] adding hyprlock and hypridle --- home/modules/hyprland.nix | 78 ++++++++++++++++++++++++++++++++++++++- pkgs/desktop-packages.nix | 4 +- qmk/qmk_firmware | 2 +- 3 files changed, 80 insertions(+), 4 deletions(-) diff --git a/home/modules/hyprland.nix b/home/modules/hyprland.nix index c1f8b94..7161106 100644 --- a/home/modules/hyprland.nix +++ b/home/modules/hyprland.nix @@ -4,6 +4,82 @@ let laptop = builtins.readFile "/etc/hostname" == "syl\n"; in { + home.file.".config/hypr/hyprlock.conf" = { + text = '' + background { + monitor = + path = /home/chris/pics/wallpapers/nixorange.png # only png supported for now + blur_passes = 3 # 0 disables blurring + blur_size = 7 + noise = 0.0117 + contrast = 0.8916 + brightness = 0.8172 + vibrancy = 0.1696 + vibrancy_darkness = 0.0 + } + input-field { + monitor = + size = 200, 50 + 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, 0.0 - 1.0 + dots_center = false + dots_rounding = -1 # -1 default circle, -2 follow input-field rounding + outer_color = rgb(151515) + inner_color = rgb(200, 200, 200) + font_color = rgb(10, 10, 10) + fade_on_empty = true + 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_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 + } + ''; + }; + home.file.".config/hypr/hypridle.conf" = { + text = '' + general { + lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances. + before_sleep_cmd = loginctl lock-session # lock before suspend. + after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display. + } + + listener { + timeout = 150 # 2.5min. + on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor. + on-resume = brightnessctl -r # monitor backlight restore. + } + + listener { + timeout = 300 # 5min + on-timeout = loginctl lock-session # lock screen when timeout has passed + } + + listener { + timeout = 330 # 5.5min + on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed + on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired. + } + + listener { + timeout = 1800 # 30min + on-timeout = systemctl suspend # suspend pc + } + ''; + }; home.file.".config/hypr/hyprpaper.conf" = { source = if laptop then /home/chris/.dotfiles/.config/hypr/hyprpaper.conf else /home/chris/.dotfiles/.config/hypr/hyprpaper.conf; }; @@ -269,7 +345,7 @@ in "kdeconnect-indicator" "wl-paste --watch cliphist store" "hyprctl setcursor phinger-cursors-light 24" - "swayidle -w timeout 300 'swaylock -S --effect-blur 20x3 --fade-in 1 --effect-vignette 0.5:1 --grace 60' timeout 600 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' before-sleep 'swaylock -S --effect-blur 20x3 --effect-vignette 0.5:1'" + "hypridle" "sleep 3 && swww img /home/chris/pics/wallpapers/nixorange.jpeg -t grow --transition-bezier .14,0,.14,.99" ]; }; diff --git a/pkgs/desktop-packages.nix b/pkgs/desktop-packages.nix index a1bb153..c0a30c0 100644 --- a/pkgs/desktop-packages.nix +++ b/pkgs/desktop-packages.nix @@ -71,8 +71,8 @@ with lib; wlrctl wl-clipboard hyprpaper - swaylock-effects - swayidle + hyprlock + hypridle aha glxinfo vulkan-tools diff --git a/qmk/qmk_firmware b/qmk/qmk_firmware index 593b51a..e783225 160000 --- a/qmk/qmk_firmware +++ b/qmk/qmk_firmware @@ -1 +1 @@ -Subproject commit 593b51a34630e67a833382a1a1a6aa6bde3c4102 +Subproject commit e783225536394759ec7e877400008ee1da7a978e