services.compton: add opacityRules option

This commit is contained in:
Maximilian Bosch 2017-10-12 16:07:52 +02:00
parent 5a8f9a8b6c
commit 4b50d543bd
No known key found for this signature in database
GPG Key ID: 091DBF4D1FC46B8E

View File

@ -7,7 +7,12 @@ let
cfg = config.services.compton;
configFile = pkgs.writeText "compton.conf"
configFile = let
opacityRules = optionalString (length cfg.opacityRules != 0)
(concatStringsSep "\n"
(map (a: "opacity-rule = [ \"${a}\" ];") cfg.opacityRules)
);
in pkgs.writeText "compton.conf"
(optionalString cfg.fade ''
# fading
fading = true;
@ -31,6 +36,8 @@ let
inactive-opacity = ${cfg.inactiveOpacity};
menu-opacity = ${cfg.menuOpacity};
${opacityRules}
# other options
backend = ${toJSON cfg.backend};
vsync = ${toJSON cfg.vSync};
@ -155,6 +162,14 @@ in {
'';
};
opacityRules = mkOption {
type = types.listOf types.str;
default = [];
description = ''
Opacity rules to be handled by compton.
'';
};
backend = mkOption {
type = types.str;
default = "glx";