From 6e1eff9aac0e8d84bda7f2d60ba6108eea9b7e79 Mon Sep 17 00:00:00 2001 From: Slabity <3788421+Slabity@users.noreply.github.com> Date: Thu, 10 Aug 2023 09:05:36 -0400 Subject: [PATCH] kanshi: support adaptive sync (#4328) --- modules/services/kanshi.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/modules/services/kanshi.nix b/modules/services/kanshi.nix index 3297d5fb0..02fe8e3cf 100644 --- a/modules/services/kanshi.nix +++ b/modules/services/kanshi.nix @@ -80,15 +80,28 @@ let Sets the output transform. ''; }; + + adaptiveSync = mkOption { + type = types.nullOr types.bool; + default = null; + example = true; + description = '' + Enables or disables adaptive synchronization + (aka. Variable Refresh Rate). + ''; + }; }; }; - outputStr = { criteria, status, mode, position, scale, transform, ... }: + outputStr = + { criteria, status, mode, position, scale, transform, adaptiveSync, ... }: ''output "${criteria}"'' + optionalString (status != null) " ${status}" + optionalString (mode != null) " mode ${mode}" + optionalString (position != null) " position ${position}" + optionalString (scale != null) " scale ${toString scale}" - + optionalString (transform != null) " transform ${transform}"; + + optionalString (transform != null) " transform ${transform}" + + optionalString (adaptiveSync != null) + " adaptive_sync ${if adaptiveSync then "on" else "off"}"; profileModule = types.submodule { options = {