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

Add a screenshot utility #82

Merged
merged 4 commits into from Dec 12, 2021
Merged

Add a screenshot utility #82

merged 4 commits into from Dec 12, 2021

Conversation

bkirwi
Copy link
Collaborator

@bkirwi bkirwi commented Dec 12, 2021

A quick screenshot script; it writes the screen contents as a PNG to the given path, or to stdout if no path is given.

This is a small amount of code, but seemed generally useful enough -- and a simple enough usage of the library -- to be worth contributing. But if y'all disagree I don't feel super strongly about it.

Copy link
Collaborator

@LinusCDE LinusCDE left a comment

Choose a reason for hiding this comment

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

This seems like a really useful addition. I'm for it.

use std::fs::OpenOptions;

fn main() {
let fb = Framebuffer::from_path("/dev/fb0");
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
let fb = Framebuffer::from_path("/dev/fb0");
let fb = Framebuffer::from_path(crate::device::CURRENT_DEVICE.get_framebuffer_path());

Autoselect the framebuffer so rm2fb-client is not needed when executing the command.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good call - done.

@LinusCDE LinusCDE merged commit ee627e1 into master Dec 12, 2021
@fenollp fenollp deleted the screenshot branch December 12, 2021 19:08
@LinusCDE LinusCDE added this to the 0.6.0 milestone Jan 17, 2022
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.

None yet

2 participants