-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Cratify #21
Cratify #21
Conversation
Why not use |
Also, I think we may need to seperate the features when being used as a library, I think |
I use I agree that
Do you have a favourite? Cheers, |
It should be possible if you don't use |
Hi @pickfire It looks like the resolution process has been fixed with the latest version of rust (1.48.0 as of writing). Cheers, |
Nice, I didn't know about it. But I have left some comments last time that wasn't resolved. Mainly related to library docs, ideally we would have description and examples for the public functions. |
I am sorry, I can not see the comments regarding the docs. I added a bit of documentation to the Also, I included a github action so it gets built on PRs and Pushes. |
Nice, thanks for putting in so much work. Can you please avoid pushing commits one by one in quick succession though? I got an email for each of those. |
I do, however, setting up CI forces me to push every time I have to add a package to the job |
That's a bit odd, shouldn't it consider pushes atomic? |
It does. Setting up CI is usually done in a separate branch because for every change one wants to test in the CI a new commit + push is needed. This should hold for the time being, so you don't have to expect so many emails in the future. On another note, do you have a similar project for wayland? Or plans to make it work with wayland? |
I've been using grim which works pretty well, it's about as simple as shotgun so I don't really feel the need to port it over. The only missing feature, which I understand is a limitation of the current Wayland protocols, is the ability to capture a window's contents directly rather than a crop of the entire desktop. The majority of shotgun is really only about getting an image from the X server, so Wayland support would involve rewriting most of it and maintaining both implementations in the same repo. Considering there's already a really good equivalent tool out there, I'd rather recommend that instead. |
That makes sense. When I switch to wayland I will look into wrapping grim from rust because I need the screenshot in my color blinder GUI application, preferably without having to save it to disk first. Regarding this PR, I added a hint for crates.io to display the README.md in the listing. |
For what it's worth I would accept a pull request for Wayland support, I'm just not really motivated to do it myself. There is definitely value in a single library crate with a unified API and multiple backends, it's just that for command line tools this simple, it's often easier to adapt your scripts to a new one than to make the program itself more complex. |
@pickfire What do you think? |
I wrote some comments but you haven't replied to the new ones. |
Thank you for the screenshot. Your review comments are still pending until you click the "finish review" button on the top right. I am working through the comments I can see in the screenshot now |
I refactored the code:
This is all the time I have currently. |
} | ||
}), | ||
xlib::NoValue => Err(ParseError::NoValue), | ||
WH_VALUES => Err(ParseError::MissingXY), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should preserve the original error, maybe keep X
and Y
separate since that is what was returned by the C function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the mentioned comment other stuff looks good to me, did not test it locally.
Thanks for sending the patching and keeping up with my comments.
This PR is really old and has a lot of conflicts, so I will be closing it. (I haven't actually followed along what happened here, I'm just cleaning up as I don't think it makes sense to keep this open.) |
Hi
I am using your code as a library for my color_blinder project.
For that I had to split it into two parts:
src/lib.rs
the public interface usable by otherssrc/bin/shotgun.rs
the remains of the formersrc/main.rs
using thesrc/lib.rs
for the core functionality.As of now, I have not been testing your application too much, but it did still make a screenshot with
cargo run
.If you are happy with the changes a new release would allow me to use a fixed version. To be clear, I had this done today in one go and it might be a little rough still.
If you wish more changes I would be happy to workout that too.
Cheers,
Stefan