diff --git a/modules/home/services/picom/default.nix b/modules/home/services/picom/default.nix new file mode 100644 index 0000000..3fc60c0 --- /dev/null +++ b/modules/home/services/picom/default.nix @@ -0,0 +1,96 @@ +{ + lib, + config, + pkgs, + ... +}: +let + inherit (lib) mkEnableOption mkIf; + + cfg = config.marleyos.services.picom; + hasXorg = config.xsession.enable; +in +{ + options.marleyos.services.picom.enable = mkEnableOption "picom"; + + config = mkIf (cfg.enable && hasXorg) { + services.picom = { + enable = true; + package = config.lib.nixGL.wrap pkgs.picom; + }; + + # The module config options are a nightmare. + xdg.configFile."picom/picom.conf".text = # conf + '' + # Shadows - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + shadow = true; + shadow-radius = 20; + shadow-opacity = .30; + shadow-offset-x = -7; + shadow-offset-y = 7; + shadow-exclude = [ + "name = 'Notification'", + "class_g = 'Conky'", + "class_g ?= 'Notify-osd'", + "class_g = 'Cairo-clock'" + ]; + + # Fading - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + fading = true; + fade-in-step = 0.03; + fade-out-step = 0.03; + + # Transparency / Opacity - - - - - - - - - - - - - - - - - - - - - - - + inactive-opacity = 0.7; + active-opacity = 0.9; + frame-opacity = 0.7; + inactive-opacity-override = false; + focus-exclude = [ "class_g = 'Cairo-clock'" ]; + opacity-rule = [ + "100:class_g = 'firefox'", + "60:class_g = 'dolphin'", + "50:class_g = 'cava'" + ]; + + # Corners - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + corner-radius = 20; + rounded-corners-exclude = [ + "window_type = 'dock'", + "window_type = 'desktop'", + "class_g = 'Dunst'" + ]; + + # Background Blurring - - - - - - - - - - - - - - - - - - - - - - - - - + blur-method = "dual_kawase"; + blur-size = 12; + blur-strength = 10; + blur-background = false; + blur-kern = "3x3box"; + blur-background-exclude = [ + "window_type = 'desktop'", + "name = 'firefox'", + "class_g = 'slop'" + ]; + + # General - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + backend = "glx"; + dithered-present = false; + vsync = true; + mark-wmwin-focused = true; + detect-rounded-corners = true; + detect-client-opacity = true; + detect-transient = true; + use-damage = false; + log-level = "warn"; + + wintypes: + { + tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; + dock = { shadow = false; clip-shadow-above = true; } + dnd = { shadow = false; } + popup_menu = { opacity = 0.8; } + dropdown_menu = { opacity = 0.8; } + }; + ''; + }; +} diff --git a/modules/home/xorg/i3/default.nix b/modules/home/xorg/i3/default.nix index e1e89d1..b62e3f1 100644 --- a/modules/home/xorg/i3/default.nix +++ b/modules/home/xorg/i3/default.nix @@ -15,8 +15,11 @@ in config = mkIf cfg.enable { marleyos = { programs.rofi = enabled; - services.polybar = enabled; - services.dunst = enabled; + services = { + picom = enabled; + polybar = enabled; + dunst = enabled; + }; }; }; }