7

I'm trying to copy a gif into my clipboard such that I would be able to paste it into web applications (slack, github, etc.).

I have tried the following without any luck:

xclip -selection clipboard -t image/gif < /path/to/image.gif
charlespwd
  • 171
  • 2
  • 2
    How do you test there's no luck? – Tagwint Jul 31 '18 at 17:00
  • 1
    You roll a d20 before running the command. If the result is a 18 or more, you have luck. – charlespwd Jul 31 '18 at 20:26
  • I came across this problem recently while writing a script. The closest I have come to a solution is copying the path to the file, which really isn't much of a solution at all. At least it lets me conveniently paste the path into the file upload dialog... Also, I noticed that when I copy a GIF from Chrome using the rclick context menu, the image gets converted to a PNG. Doesn't look promising. – Joe Apr 13 '19 at 19:57
  • FWIW, that works perfectly fine for me with xclip 0.13. – Stéphane Chazelas May 28 '23 at 11:08

2 Answers2

0

You can do

/opt/dragon --on-top --and-exit image.gif & sleep 0.1
/opt/dragon --on-top --and-exit cover.mp4 & sleep 0.3

and use xdotool to drag drop

Benjamin Loison
  • 180
  • 1
  • 5
0
xclip -selection clipboard -t image/gif -i /path/to/image.gif
Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250