From 8ddfb1674983ea89092a4b58e3081f974672bbf6 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Tue, 7 May 2024 08:46:26 +0200 Subject: [PATCH] sway: Only add swayfx config if it is being used --- home-manager/modules/sway/default.nix | 34 +++++++++++++++------------ 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/home-manager/modules/sway/default.nix b/home-manager/modules/sway/default.nix index 35586fa..b42bef6 100644 --- a/home-manager/modules/sway/default.nix +++ b/home-manager/modules/sway/default.nix @@ -284,25 +284,29 @@ in startup = cfg.startup; }; - extraConfig = '' - for_window [app_id="^.*"] inhibit_idle fullscreen - for_window [class="^.*"] inhibit_idle fullscreen - for_window [app_id="org.gnome.Calculator"] floating enable - for_window [shell="xwayland"] title_format "%title [XWayland]" - for_window [app_id="^.*iwgtk$"] floating enable + extraConfig = builtins.concatStringsSep "\n" ( + [ + '' + for_window [app_id="^.*"] inhibit_idle fullscreen + for_window [class="^.*"] inhibit_idle fullscreen + for_window [app_id="org.gnome.Calculator"] floating enable + for_window [shell="xwayland"] title_format "%title [XWayland]" + for_window [app_id="^.*iwgtk$"] floating enable - blur enable - blur_xray disable + include /etc/sway/config.d/* + '' + ] + ++ lib.optional (cfg.package == pkgs.swayfx) '' + blur enable + blur_xray disable - shadows enable + shadows enable - default_dim_inactive 0.2 + default_dim_inactive 0.2 - corner_radius 10 - - - include /etc/sway/config.d/* - ''; + corner_radius 10 + '' + ); # exec --no-startup-id ${pkgs.swaynotificationcenter}/bin/swaync # exec --no-startup-id ${pkgs.networkmanagerapplet}/bin/nm-applet --indicator # exec --no-startup-id ${pkgs.swayidle}/bin/swayidle -w timeout 900 "${swaylockcmd}"