Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaults: add screencapture.target option #1242

Merged
merged 3 commits into from
Dec 29, 2024

Conversation

filipkania
Copy link
Contributor

Adds the ability to set com.apple.screencapture.target default, which tells screencapture to output screenshot to e.g. clipboard. I prefer to put my screenshots directly into my clipboard, and there wasn't an option to do that through nix-darwin, so i've made the PR :)

Tested it using different valid values on Sequoia, valid values were observed by setting different "Save to" settings and reading using defaults read com.apple.screencapture target:

untitled

@filipkania filipkania changed the title feat: add screencapture.target option defaults: add screencapture.target option Dec 28, 2024
@Enzime
Copy link
Collaborator

Enzime commented Dec 28, 2024

Can you update the tests?

@filipkania
Copy link
Contributor Author

sure!

@@ -48,5 +48,20 @@ with lib;
Show thumbnail after screencapture before writing to file. The default is true.
'';
};

system.defaults.screencapture.target = mkOption {
type = types.nullOr types.str;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type = types.nullOr types.str;
type = types.nullOr (types.enum [ "file" "clipboard" ... ]);

@filipkania filipkania requested a review from Enzime December 29, 2024 10:56
Copy link
Collaborator

@Enzime Enzime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks for the contribution

@Enzime Enzime merged commit 713da7b into LnL7:master Dec 29, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants