autorandr: remove blank lines from config

Fixes #1249.
This commit is contained in:
Nikita Uvarov 2020-05-26 14:00:33 +02:00 committed by Robert Helgesson
parent 09304026ae
commit 99a97c917a
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -244,21 +244,21 @@ let
]); ]);
fingerprintToString = name: edid: "${name} ${edid}"; fingerprintToString = name: edid: "${name} ${edid}";
configToString = name: config: configToString = name: config:
if config.enable then '' if config.enable then
output ${name} concatStringsSep "\n" ([ "output ${name}" ]
${optionalString (config.position != "") "pos ${config.position}"} ++ optional (config.position != "") "pos ${config.position}"
${optionalString config.primary "primary"} ++ optional config.primary "primary"
${optionalString (config.dpi != null) "dpi ${toString config.dpi}"} ++ optional (config.dpi != null) "dpi ${toString config.dpi}"
${optionalString (config.gamma != "") "gamma ${config.gamma}"} ++ optional (config.gamma != "") "gamma ${config.gamma}"
${optionalString (config.mode != "") "mode ${config.mode}"} ++ optional (config.mode != "") "mode ${config.mode}"
${optionalString (config.rate != "") "rate ${config.rate}"} ++ optional (config.rate != "") "rate ${config.rate}"
${optionalString (config.rotate != null) "rotate ${config.rotate}"} ++ optional (config.rotate != null) "rotate ${config.rotate}"
${optionalString (config.scale != null) ++ optional (config.transform != null) ("transform "
((if config.scale.method == "factor" then "scale" else "scale-from") + concatMapStringsSep "," toString (flatten config.transform))
+ " ${toString config.scale.x}x${toString config.scale.y}")} ++ optional (config.scale != null)
${optionalString (config.transform != null) ("transform " ((if config.scale.method == "factor" then "scale" else "scale-from")
+ concatMapStringsSep "," toString (flatten config.transform))} + " ${toString config.scale.x}x${toString config.scale.y}"))
'' else '' else ''
output ${name} output ${name}
off off
''; '';