Merge pull request #30364 from Ma27/compton/opacity-rules-support

services.compton: add `opacityRules` option

authored by Franz Pletz and committed by GitHub c6218193 98d5aa05

+17 -2
+17 -2
nixos/modules/services/x11/compton.nix
··· 7 8 cfg = config.services.compton; 9 10 - configFile = pkgs.writeText "compton.conf" 11 (optionalString cfg.fade '' 12 # fading 13 fading = true; ··· 30 active-opacity = ${cfg.activeOpacity}; 31 inactive-opacity = ${cfg.inactiveOpacity}; 32 menu-opacity = ${cfg.menuOpacity}; 33 - 34 # other options 35 backend = ${toJSON cfg.backend}; 36 vsync = ${toJSON cfg.vSync}; ··· 152 example = "0.8"; 153 description = '' 154 Opacity of dropdown and popup menu. 155 ''; 156 }; 157
··· 7 8 cfg = config.services.compton; 9 10 + configFile = let 11 + opacityRules = optionalString (length cfg.opacityRules != 0) 12 + (concatStringsSep "\n" 13 + (map (a: "opacity-rule = [ \"${a}\" ];") cfg.opacityRules) 14 + ); 15 + in pkgs.writeText "compton.conf" 16 (optionalString cfg.fade '' 17 # fading 18 fading = true; ··· 35 active-opacity = ${cfg.activeOpacity}; 36 inactive-opacity = ${cfg.inactiveOpacity}; 37 menu-opacity = ${cfg.menuOpacity}; 38 + 39 + ${opacityRules} 40 + 41 # other options 42 backend = ${toJSON cfg.backend}; 43 vsync = ${toJSON cfg.vSync}; ··· 159 example = "0.8"; 160 description = '' 161 Opacity of dropdown and popup menu. 162 + ''; 163 + }; 164 + 165 + opacityRules = mkOption { 166 + type = types.listOf types.str; 167 + default = []; 168 + description = '' 169 + Opacity rules to be handled by compton. 170 ''; 171 }; 172