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

Screenshot selection #1278

Closed
KorigamiK opened this issue Jan 2, 2025 · 4 comments
Closed

Screenshot selection #1278

KorigamiK opened this issue Jan 2, 2025 · 4 comments

Comments

@KorigamiK
Copy link

Would be nice to use a rect selection to export and copy to clipboard.
Perhaps an option to export an image as well?

@ahrm
Copy link
Owner

ahrm commented Jan 2, 2025

We do have a copy_screenshot_to_clipboard command.

@KorigamiK
Copy link
Author

great, love it, but would be nice to have something like save_selection_sceenshot which prompts for a file name?

@ahrm
Copy link
Owner

ahrm commented Jan 4, 2025

I think this is too niche to implement directly, but in d461d19 I made some fixes which now allows you to implement it using a custom javascript command like so:
screenshot.js

let selected_rect = JSON.parse(sioyek.select_rect());
let window_rect = sioyek_api.absolute_to_window_rect_json(selected_rect);
let screenshot_file_name = sioyek.show_text_prompt('Screenshot file name');
sioyek_api.screenshot_js("e:/sioyek_screenshots/" + screenshot_file_name + ".png", window_rect);

prefs_user.config:

new_async_js_command _save_screenshot screenshot.js

@KorigamiK
Copy link
Author

Oh cool the js api is a nice addition, I'll make sure to look into that

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

No branches or pull requests

2 participants