1
1
Fork 0

niri: add disabled outputs option

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2025-01-02 12:01:56 -06:00
parent 5ba120d754
commit a8b86890db
Signed by: Myned
GPG key ID: C7224454F7881A34
3 changed files with 25 additions and 11 deletions

View file

@ -15,6 +15,11 @@
refresh = 100; refresh = 100;
#// vrr = true; #// vrr = true;
desktops.niri.output = {
connectors = ["DP-1" "DP-2" "DP-3"];
disabled = ["HDMI-A-1" "HDMI-A-2" "HDMI-A-3"];
};
programs.looking-glass = { programs.looking-glass = {
enable = true; enable = true;
igpu = true; igpu = true;

View file

@ -102,6 +102,10 @@ in {
# https://github.com/sodiboo/niri-flake/blob/main/docs.md#programsnirisettingsdebug # https://github.com/sodiboo/niri-flake/blob/main/docs.md#programsnirisettingsdebug
settings.debug = { settings.debug = {
#// disable-direct-scanout = []; #// disable-direct-scanout = [];
# BUG: Crash when multiple outputs from the same monitor are enabled
# https://github.com/YaLTeR/niri/issues/734
disable-monitor-names = [];
}; };
}; };
} }

View file

@ -9,6 +9,7 @@ in {
options.custom.desktops.niri.output = { options.custom.desktops.niri.output = {
enable = mkOption {default = false;}; enable = mkOption {default = false;};
connectors = mkOption {default = [];}; connectors = mkOption {default = [];};
disabled = mkOption {default = [];};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -18,20 +19,24 @@ in {
# https://github.com/sodiboo/niri-flake/blob/main/docs.md#programsnirisettingsoutputs # https://github.com/sodiboo/niri-flake/blob/main/docs.md#programsnirisettingsoutputs
#?? niri msg outputs #?? niri msg outputs
programs.niri.settings.outputs = listToAttrs (forEach cfg.connectors (connector: { programs.niri.settings.outputs = listToAttrs (forEach cfg.connectors (connector: {
name = connector; name = connector;
value = { value = {
background-color = "#073642"; background-color = "#073642";
mode = with config.custom; { mode = with config.custom; {
inherit width height; inherit width height;
refresh = refresh + 0.0; # Convert to float refresh = refresh + 0.0; # Convert to float
};
scale = config.custom.scale;
variable-refresh-rate = mkIf config.custom.vrr "on-demand"; #!! Requires window-rule
}; };
})
scale = config.custom.scale; ++ (forEach cfg.disabled (connector: {
variable-refresh-rate = mkIf config.custom.vrr "on-demand"; #!! Requires window-rule name = connector;
}; value = {enable = false;};
})); })));
} }
]; ];
}; };