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

Copying using xclip not showing as image #39

Closed
chaiNeehujui opened this issue Oct 22, 2024 · 9 comments
Closed

Copying using xclip not showing as image #39

chaiNeehujui opened this issue Oct 22, 2024 · 9 comments

Comments

@chaiNeehujui
Copy link

Hi. Thank you for this awesome tool.
The problem I'm having is that when I copy an image file using xclip, it doesn't appear as an image in the TUI app.
It just shows as "Unable to display format of type ""."

You should be able to reproduce it by using the following command:
xclip -selection clipboard -t image/png -i A_PICTURE_FILE.png

@SUPERCILEX
Copy link
Owner

Apologies for the delay, I was able to reproduce this. Unfortunately, I believe it's a compositor bug as running xclip -selection clipboard -t UTF8_STRING -o returns data instead of erroring out. But xclip -selection clipboard -t TARGETS -o correctly says there's just image/png.

The watcher works by first querying for UTF8_STRING assuming that the vast majority of what you copy is text, and only if that query fails do we query for targets and then pick the appropriate one.

How much of an annoyance would it be to use the ringboard CLI? You can do ringboard add foo.png and it'll Just Work™️. If that breaks your workflow, I can consider adding a config option to disable the fast path query which would fix this bug at the cost of being a little slower every other time.

@chaiNeehujui
Copy link
Author

chaiNeehujui commented Nov 9, 2024

Using the ringboard CLI is somewhat less convenient because I also need to use the TUI app to sync content with the system clipboard. Or whenever I want to copy an image (in my case, I copy the output of the screenshot tool (maim)), I use xclip to copy it and then manually add it to the ringboard, which results in duplicated content.

I don't know but adding a command line option to the x11 TUI to sync the last added value to the system clipboard might also be an option or, anyway, I think what you suggested sounds better and is more convenient too.

@SUPERCILEX
Copy link
Owner

What if I added a flag to the ringboard CLI that made it put the contents in the system clipboard too? So you could run maim -s | ringboard add -m image/png --copy?

@chaiNeehujui
Copy link
Author

I thought the ringboard CLI is display server agnostic. Otherwise it would be amazing :)

@SUPERCILEX
Copy link
Owner

It is, but the cli can tell the watcher to offer a file for pasting.

@SUPERCILEX
Copy link
Owner

I'm going to dog food this through next week and then I'll make a release assuming all goes well.

@chaiNeehujui
Copy link
Author

Thank you so much!

@SUPERCILEX
Copy link
Owner

Released! https://github.com/SUPERCILEX/clipboard-history/releases/tag/0.7.0

@chaiNeehujui
Copy link
Author

It works perfectly. Thanks again ♥️

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