From 30f71eefd43c83d4363793851c70f1cdee4e6289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 11 Jan 2023 10:39:29 +0100 Subject: [PATCH] add options for blur and shadows --- modules/programs/hyprland/config.nix | 16 +++++++++++----- modules/programs/hyprland/default.nix | 10 ++++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/modules/programs/hyprland/config.nix b/modules/programs/hyprland/config.nix index 943db5e..70316e6 100644 --- a/modules/programs/hyprland/config.nix +++ b/modules/programs/hyprland/config.nix @@ -6,6 +6,10 @@ with lib; let + cfg = config.my.programs.hyprland; + + boolToYesNo = bool: if bool then "yes" else "no"; + mkRule = rule: windowRegexes: "windowrulev2 = ${rule},${concatStringsSep "," windowRegexes}"; mkRules = rules: windowRegexes: concatStringsSep "\n" (map (flip mkRule windowRegexes) rules); in @@ -55,12 +59,12 @@ in # See https://wiki.hyprland.org/Configuring/Variables/ for more rounding = 3 - blur = yes + blur = ${boolToYesNo cfg.blur} blur_size = 3 blur_passes = 3 blur_new_optimizations = on - drop_shadow = yes + drop_shadow = ${boolToYesNo cfg.shadows} shadow_range = 10 shadow_render_power = 2 @@ -109,17 +113,19 @@ in # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + ${optionalString cfg.blur '' # Kitty windowrulev2 = opacity 0.95 0.95, class:^kitty$ + # Rofi + ${mkRules ["float" "opacity 0.85 0.85" "noborder"] ["class:^([rR]ofi)$"]} + windowrulev2 = opacity 0.85 0.85, floating:1 + ''} # Firefox Sharing Indicator ${mkRules ["float" "move 49% 40" "noborder"] ["title:^(.*Sharing Indicator)$"]} - # Rofi - ${mkRules ["float" "opacity 0.85 0.85" "noborder"] ["class:^([rR]ofi)$"]} - # Emacs windowrulev2 = opaque, class:^emacs$ diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index a45a56a..b8758d0 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -15,6 +15,16 @@ in options.my.programs.hyprland = { enable = mkEnableOption "hyprland"; nvidiaSupport = mkEnableOption "enable nvidia Support"; + blur = mkOption { + type = types.bool; + description = "enable window blurring"; + default = true; + }; + shadows = mkOption { + type = types.bool; + description = "enable window shadows"; + default = true; + }; }; config = mkIf cfg.enable {