Skip to content

Commit a6bbdf6

Browse files
committed
hm-mod: monitors: add disable option
1 parent 9865ce7 commit a6bbdf6

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

hm-module/monitors.nix

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ let
6161

6262
monitorDefType = types.submodule ({ config, ... }: {
6363
# <https://github.com/NixOS/nixpkgs/issues/96006>
64-
imports = [ (lib.mkRenamedOptionModule [ "name" ] [ "output" ]) ];
64+
imports = [
65+
(lib.mkRenamedOptionModule [ "name" ] [ "output" ])
66+
# @Ujinn34 wanted this option to be named `disable`.
67+
# <https://github.com/hyprwm/Hyprland/discussions/10848#discussioncomment-13583976>
68+
(lib.mkRenamedOptionModule [ "disabled" ] [ "disable" ])
69+
];
6570

6671
options = {
6772
output = lib.mkOption {
@@ -79,6 +84,13 @@ let
7984
`hyprctl monitors` (without the parenthesized name at the end).
8085
'';
8186
};
87+
disable = lib.mkOption {
88+
type = types.bool;
89+
default = false;
90+
description = ''
91+
Disable this monitor, removing it from the layout.
92+
'';
93+
};
8294
position = lib.mkOption {
8395
type = types.either (point2DType types.ints.unsigned) (types.enum [
8496
"auto"
@@ -278,6 +290,7 @@ in {
278290
wayland.windowManager.hyprland.config.monitorv2 = lib.mapAttrsToList
279291
(_: def: {
280292
inherit (def) output;
293+
disabled = lib.mkIf def.disable def.disable;
281294
mode = def.modeString;
282295
position = def.positionString;
283296
scale = lib.mkIf (def.scale != 1.0) def.scale;

0 commit comments

Comments
 (0)