From 6d3e618ed54d01ac16dedc8623675dfda97dee9d Mon Sep 17 00:00:00 2001 From: Myned Date: Tue, 31 Dec 2024 12:43:57 -0600 Subject: [PATCH] custom: add vrr option Signed-off-by: Myned --- machines/mynix/default.nix | 3 ++- options/custom/default.nix | 1 + options/custom/desktops/niri/output.nix | 2 ++ options/custom/desktops/niri/rules.nix | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/machines/mynix/default.nix b/machines/mynix/default.nix index f6b8400..2ca919b 100644 --- a/machines/mynix/default.nix +++ b/machines/mynix/default.nix @@ -13,7 +13,8 @@ width = 3440; height = 1440; refresh = 100; - desktops.niri.output.connectors = ["DP-1" "HDMI-A-1"]; + vrr = true; + desktops.niri.output.connectors = ["DP-1" "DP-2" "DP-3" "HDMI-A-1" "HDMI-A-2" "HDMI-A-3"]; programs.looking-glass = { enable = true; diff --git a/options/custom/default.nix b/options/custom/default.nix index 26c1b76..c11e883 100644 --- a/options/custom/default.nix +++ b/options/custom/default.nix @@ -24,6 +24,7 @@ in { width = mkOption {default = 1920;}; height = mkOption {default = 1080;}; refresh = mkOption {default = 60;}; + vrr = mkOption {default = false;}; ultrawide = mkOption {default = cfg.width * 9 / 16 > cfg.height;}; # Wider than 16:9 hidpi = mkOption {default = cfg.scale > 1;}; scale = mkOption {default = 1;}; diff --git a/options/custom/desktops/niri/output.nix b/options/custom/desktops/niri/output.nix index 2be9a01..d3b0565 100644 --- a/options/custom/desktops/niri/output.nix +++ b/options/custom/desktops/niri/output.nix @@ -15,6 +15,7 @@ in { home-manager.sharedModules = [ { # https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs + #?? niri msg outputs programs.niri.settings.outputs = listToAttrs (forEach cfg.connectors (connector: { name = connector; @@ -27,6 +28,7 @@ in { }; scale = config.custom.scale; + variable-refresh-rate = mkIf config.custom.vrr "on-demand"; #!! Requires window-rule }; })); } diff --git a/options/custom/desktops/niri/rules.nix b/options/custom/desktops/niri/rules.nix index 14bdd0c..5e61bfd 100644 --- a/options/custom/desktops/niri/rules.nix +++ b/options/custom/desktops/niri/rules.nix @@ -96,7 +96,8 @@ in { # Games matches = [ {app-id = "^.*\.(exe|x86_64)$";} - {app-id = "^moe\.launcher\..+$";} + {app-id = "^love$";} # vrrtest + {app-id = "^moe\.launcher\..+$";} # Anime Game Launcher {app-id = "^net\.retrodeck\.retrodeck$";} {app-id = "^steam_app_.+$";} ];