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

Support for copying image with correct targets #29

Open
dhanjit opened this issue Oct 30, 2018 · 2 comments
Open

Support for copying image with correct targets #29

dhanjit opened this issue Oct 30, 2018 · 2 comments

Comments

@dhanjit
Copy link

dhanjit commented Oct 30, 2018

This are the TARGETS when I do a simple right click -> copy image on firefox. The same goes for chrome.

❯ xclip -selection clipboard -t TARGETS -o
TIMESTAMP
TARGETS
MULTIPLE
SAVE_TARGETS
text/html
text/_moz_htmlinfo
text/_moz_htmlcontext
image/png
image/bmp
image/x-bmp
image/x-MS-bmp
image/x-icon
image/x-ico
image/x-win-bitmap
image/vnd.microsoft.icon
application/ico
image/ico
image/icon
text/ico
image/jpeg
image/tiff

This is what I get with xsel.

~/Pictures
❯ xsel -b < mpv-shot0001.jpg

~/Pictures
❯ xclip -selection clipboard -t TARGETS -o
TIMESTAMP
MULTIPLE
TARGETS
DELETE
INCR
TEXT
UTF8_STRING
STRING

And ofcourse pasting the image is something like hangouts doesn't work.

Sadly, currently xclip also doesn't correctly copy an image from file. Neither does any other such tool. CopyQ (https://github.com/hluk/CopyQ) is a heavy alternative to this but doesn't have a non-daemon mode.

It would be good to have xsel support it, as there are no lightweight alternatives currently. Also xsel is already used by many folk and other applications.

@cameron1729
Copy link

This actually works now. At least on my system running xsel 1.2.0:

``
~ ❯❯❯ xsel -b < 099.jpg
~ ❯❯❯ xclip -seletion clipboard -t TARGETS -o
TIMESTAMP
TARGETS
MULTIPLE
text/html
text/_moz_htmlcontext
text/_moz_htmlinfo
UTF8_STRING
COMPOUND_TEXT
TEXT
STRING
text/plain;charset=utf-8
text/plain
text/x-moz-url-priv


And CTRL+v in to various applications seems to work fine.

@cameron1729
Copy link

cameron1729 commented Mar 27, 2024

Scratch that, it only kinda works. If I've previously copied a file from my file browser to the clipboard then sometimes using xsel to put a different file in the clipboard works, but not always.

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