I am using ImageMagick to copy a portion of my screen into a temporary file (something.png). I would now like to paste the contents of this file into the clipboard directly from 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 perfectly for command line copying and pasting, but I can’t get it to work with image. I reckon this is not a feature of parcellite. How could I do that then ?
Have a look at xclip
, especially at xclip-copyfile
and xclip-pastefile
.
xclip -i < yourfile.png
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With