Add more spectacle shortcuts (#79)

This commit is contained in:
magnouvean 2024-03-03 14:55:38 +01:00 committed by GitHub
parent 132e00af06
commit 8de2af1270
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -67,6 +67,33 @@ in
The shortcut for launching Spectacle without capturing.
'';
};
recordRegion = lib.mkOption {
type = with lib.types; nullOr (oneOf [ (listOf str) str ]);
default = null;
example = "Meta+Shift+R";
description = ''
The shortcut for recording a region on the screen.
'';
};
recordScreen = lib.mkOption {
type = with lib.types; nullOr (oneOf [ (listOf str) str ]);
default = null;
example = "Meta+Alt+R";
description = ''
The shortcut for selecting a screen to record.
'';
};
recordWindow = lib.mkOption {
type = with lib.types; nullOr (oneOf [ (listOf str) str ]);
default = null;
example = "Meta+Ctrl+R";
description = ''
The shortcut for selecting a window to record.
'';
};
};
config = lib.mkIf cfg.enable {
@ -106,6 +133,21 @@ in
OpenWithoutScreenshot = cfg.spectacle.shortcuts.launchWithoutCapturing;
}
)
(
lib.mkIf (cfg.spectacle.shortcuts.recordRegion != null) {
RecordRegion = cfg.spectacle.shortcuts.recordRegion;
}
)
(
lib.mkIf (cfg.spectacle.shortcuts.recordScreen != null) {
RecordScreen = cfg.spectacle.shortcuts.recordScreen;
}
)
(
lib.mkIf (cfg.spectacle.shortcuts.recordWindow != null) {
RecordWindow = cfg.spectacle.shortcuts.recordWindow;
}
)
];
};
}