Git Product home page Git Product logo

Comments (14)

ribosomerocker avatar ribosomerocker commented on August 23, 2024 1

No problem! And thank you for writing this amazingly nicely documented tool haha, it's been really fun to explore the tool and how it was structured, and the way it works is really nice to me. Thank you for your response!

from menyoki.

orhun avatar orhun commented on August 23, 2024 1

Moving on...

[...] one of the things I kind of dislike is that menyoki doesn't implicitly set the q flag when it detects being piped to something, sort of like Bat(1), a Cat(1) clone in Rust.

Now it does 🥳 (ced887b)

from menyoki.

ribosomerocker avatar ribosomerocker commented on August 23, 2024 1

Can you try it again and report what you got?

It seems to successfully work, capturing my entire desktop.

from menyoki.

ribosomerocker avatar ribosomerocker commented on August 23, 2024 1

You can give slop a shot maybe. e.g. menyoki cap --root --size $(slop -k)

Yes, that does exactly what I hoped for!

from menyoki.

ribosomerocker avatar ribosomerocker commented on August 23, 2024 1

I don't think so! I believe the only things left are the "raw" X/Rust errors, which you already made an issue for, so I believe about most of the stuff I've asked for is done for now! Thank you for such a quick answer and the cooperation. You can close the issue if you want, I'm completely pleased with the solutions we came across on this haha.

from menyoki.

orhun avatar orhun commented on August 23, 2024

Thank you for the detailed report! I'll try to look into the things that I can implement/fix out of this. As far as I can tell there are some missing features and unexpected issues with the collective use of some command-line options. I'll keep this issue updated as I proceed with the attempt of reproducing/taking an implementation into consideration. Just a side note, we might have to break this issue down to separate issues to discuss them separately in the future.
Thank you again for taking your time for this review :)

from menyoki.

orhun avatar orhun commented on August 23, 2024

Okay, let's start with this:

I'd also suggest making mouse-clicks work to select windows by default? It's really annoying to have to press Alt+S+Enter, it doesn't feel exactly like a sane default, IMHO.

Although it's possible to use mouse interaction to select windows with a 3rd party tool (as explained here), I guess it doesn't hurt to have this feature built-in. So I made this possible via --mouse flag for record/capture subcommands: f338a69

-m, --mouse Select the window with mouse click

It's a very simple implementation and it doesn't have a complex logic for now. Thus I didn't make it as the default behavior for selecting windows. It can be set to default easily with a configuration file entry or environment variables, though.

I'm still trying out this feature so discussing this on another issue would be good if you came across any problems or if you have further ideas about it.

from menyoki.

ribosomerocker avatar ribosomerocker commented on August 23, 2024

Alright! I've tried it out and I've gotten into a couple problems with it. I'll create an issue real quick

from menyoki.

orhun avatar orhun commented on August 23, 2024

One more thing, it for some reason looks like --with-alpha is completely useless, I'm not sure what the use for it is.

let alpha = if self.alpha_channel { bgra[3] } else { 255 };

--with-alpha basically tells image encoder to use the actual alpha value that is taken from window instead of plain 255. So if you have grabbed a transparent image, it won't be encoded as transparent as long as you don't provide --with-alpha flag. Of course, it depends on the image format. Needles to say: you can't encode transparent JPEGs.

Say that you have a compositor that sets your windows' transparency by default, if you use something like:
menyoki -q cap --focus --with-alpha png save - | xclip -selection clipboard -t image/png
You will not get what was behind the window, because of it's transparency level, but you'll just get the window in normal transparency. What I thought I'd try to do that might incorporate my wallpaper, since that was what my goal was to include in my screenshot, was use the root option, but it cannot be used with focus , so I can't really get what the window actually looks like.

That's the expected behaviour. You can't capture couple of windows together with --focus. If you focus on a transparent window, it will only capture that window. Your wallpaper is a part of your root window in this case. But, indeed, you can use --root as following:

menyoki -q cap --select --root png save - | xclip -selection clipboard -t image/png

Then you will have to resize the capture area for capturing the window you want. It's expected to include transparency because you're basically capturing what you see on your entire screen.

There's actually a raw X error that I recieve when I try:
menyoki -q cap --parent --root png save - | xclip -selection clipboard -t image/png

That might be about the use of --parent. It seems redundant because you're already using --root. I'll look into this in #21.

Can you try it again and report what you got?

from menyoki.

orhun avatar orhun commented on August 23, 2024

I dislike is how long and sort of convoluted it makes your entire command to be, can you add in some ways to shorten more options, flags, and commands, maybe add in ways to do stuff easier than they can be done right now? I'd like if I just had to do:
menyoki cap -fa - | xclip -selection clipboard -t image/png, or maybe just try to make the copying part easier:
menyoki cap -Cfa, I believe this might be of very big help.

Sure, that'd be good. But in this specific case I'm not sure if I want to add -C for copying the output. I feel like this should be done by the user. And one can always use shell aliases. e.g. I have this in my .bash_aliases:

alias c='xclip -selection clipboard'
alias cap='menyoki -q cap --root --size $(slop -k) png save - | 0x0 - 2>/dev/null | c'

But I can add some shortcuts/extra flags for other usages. Do you have any other suggestions?

What do you think?

from menyoki.

ribosomerocker avatar ribosomerocker commented on August 23, 2024

About the copying part, I completely understand and agree with you on that one. I just had the idea back then to maybe make it "easier" to use, but it just seems like something that the user should do, I agree. About the transparency part, the reason I tried to use the focus flag with the root flag is to provide me a faster method to just capture an entire window with transparency, but maybe there might be a way to use a different tool to sort of "pipe" the window's position to the selection flag, so that it just selects the window using sort of "automatic" selection, but I feel like I might be asking too much haha, so it is fine if this wasn't implemented, I'm just saying a few ideas. Unfortunately, I'm not at my home, so I can't really re-run it, I'll be able to by tomorrow, though.

from menyoki.

orhun avatar orhun commented on August 23, 2024

About the transparency part, the reason I tried to use the focus flag with the root flag is to provide me a faster method to just capture an entire window with transparency, but maybe there might be a way to use a different tool to sort of "pipe" the window's position to the selection flag, so that it just selects the window using sort of "automatic" selection, but I feel like I might be asking too much haha, so it is fine if this wasn't implemented, I'm just saying a few ideas.

Yeah, something like that is not implemented (yet?).
You can give slop a shot maybe. e.g. menyoki cap --root --size $(slop -k)

Unfortunately, I'm not at my home, so I can't really re-run it, I'll be able to by tomorrow, though.

👍🏼

from menyoki.

orhun avatar orhun commented on August 23, 2024

Awesome to hear!

I wonder if there's anything I missed / not covered in this issue. Anything else?

from menyoki.

orhun avatar orhun commented on August 23, 2024

Nice! Feel free to submit other issues/ideas if you come across any other problems, thank you!

from menyoki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.