From e87ff2264391b456e2f926704ddbd02725523ada Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Tue, 8 Apr 2025 13:08:34 -0700 Subject: [PATCH] chore: rename useNvidiaCrashFix -> useCrashFix --- hm/modules/linux/desktop-environment/hyprland/default.nix | 7 +++---- .../linux/desktop-environment/hyprland/utilities.nix | 7 ++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/hm/modules/linux/desktop-environment/hyprland/default.nix b/hm/modules/linux/desktop-environment/hyprland/default.nix index 059ccbe..0a96798 100644 --- a/hm/modules/linux/desktop-environment/hyprland/default.nix +++ b/hm/modules/linux/desktop-environment/hyprland/default.nix @@ -44,11 +44,11 @@ in Whether to set up Hyprlock for screen locking. ''; }; - screenlocker.useNvidiaCrashFix = lib.mkOption { + screenlocker.useCrashFix = lib.mkOption { type = lib.types.bool; default = false; description = '' - Whether to use a workaround for Hyprlock background blur not working on Nvidia-based machines. Before locking, a screenshot will be taken and placed at `/tmp/__hyprlock-monitor-screenshot.png`. + Whether to use a workaround for Hyprlock background blur not working on some machines. Before locking, a screenshot will be taken and placed at `/tmp/__hyprlock-monitor-screenshot.png`. ''; }; screenlocker.monitor = lib.mkOption { @@ -229,8 +229,7 @@ in assertions = [ { assertion = - !cfg.screenlocker.useNvidiaCrashFix - || (cfg.screenlocker.useNvidiaCrashFix && cfg.screenlocker.monitor != null); + !cfg.screenlocker.useCrashFix || (cfg.screenlocker.useCrashFix && cfg.screenlocker.monitor != null); message = "To use the Nvidia crash fix, you must set screenlocker.monitor to the monitor you want to use as the lock screen that blurs! Use `hyprctl monitors` to determine the monitor codes (should be something like DP-1, HDMI-A-1, etc)."; } ]; diff --git a/hm/modules/linux/desktop-environment/hyprland/utilities.nix b/hm/modules/linux/desktop-environment/hyprland/utilities.nix index e1c2b12..068d46c 100644 --- a/hm/modules/linux/desktop-environment/hyprland/utilities.nix +++ b/hm/modules/linux/desktop-environment/hyprland/utilities.nix @@ -58,10 +58,7 @@ in background = { monitor = cfg.screenlocker.monitor; path = - if cfg.screenlocker.useNvidiaCrashFix then - "/tmp/__hyprlock-monitor-screenshot.png" - else - "screenshot"; + if cfg.screenlocker.useCrashFix then "/tmp/__hyprlock-monitor-screenshot.png" else "screenshot"; blur_passes = 3; blur_size = 7; noise = 0.0117; @@ -109,7 +106,7 @@ in settings = { general = { lock_cmd = - if cfg.screenlocker.useNvidiaCrashFix then + if cfg.screenlocker.useCrashFix then "pidof hyprlock || ${pkgs.grim}/bin/grim -o ${config.programs.hyprlock.settings.background.monitor} /tmp/__hyprlock-monitor-screenshot.png && ${pkgs.hyprlock}/bin/hyprlock" else "pidof hyprlock || hyprlock";