When I have binary content on my clipboard, I want to dump it into a file. For example, on an internet browser I could right click on an image and click "Copy Image", the image data will be then, copied to my clipboard, which I can easily paste on image editing softwares. Now I want to dump the image into a file:
So from this question: How to pipe/dump clipboard contents to a file?
I tried these:
xsel -b > Picture.jpg
xclip -selection clipboard -o > Picture.jpg
gpaste-client get 0 > Picture.jpg
But the file always contains 0 bytes.
When I pipe these commands to od
and xxd
or cat
I just get 0000000
or nothing at all.
When the clipboard contains a string, these commands ALL work fine, but when it's binary, nothing works!