Copy image to clipboard from command line

I use ImageMagick to copy part of my screen to a temporary file (something.png). Now I would like to paste the contents of this file into the clipboard directly from the command line.

So far, my script looks like this:

#!/bin/bash TMPFILE=$(mktemp) FORMAT='.PNG' SCREENSHOT_FILE=${TMPFILE}${FORMAT} mv "$TMPFILE" "$SCREENSHOT_FILE" import "$SCREENSHOT_FILE" cat "$SCREENSHOT_FILE" | parcellite rm "$SCREENSHOT_FILE" 

Parcellite works great for copy and paste on the command line, but I can not get it to work with the image. I believe that this is not a feature of parcellite. How could I do this?

+4
source share
1 answer

Take a look at xclip , especially on the xclip-copyfile and xclip-pastefile .

  xclip -i < yourfile.png 
+4
source

All Articles