I'm making a custom script that uses ImageMagick to take screenshots because I deleted the original application and wanted to do a custom one.
#! /bin/sh.
cd magickScreenshots/
ls -v | cat -n | while read n f; do mv -n "$f" "$n.jpg"; done
import /home/alnexus/magickScreenshots/screenshot.jpg -quality 100 -trim
What that does is, it goes into the magickScreenshots folder, then renames everything to numbers, and it then uses ImageMagick to take a screenshot (I have to select an area for it to screenshot). The problem is, it only saves the image as screenshot.jpg
in that folder (by the way the second line is just so that it renames all files and the new screenshot.jpg doesn't replace the old one, I want to keep all screenshots every session, they all get deleted when the computer starts up). I want to make it so that the screenshot.jpg
file is automatically inserted into my clipboard. I tried some stuff but they all only copied the directory from the image, not the image itself (I had used the xclip command only). I've searched a lot and nothing worked, I even tried xclip-copyfile and it didn't seem to work, though I didn't mess with it very much
EDIT
I tried xclip -selection clipboard -t image/png ~/magickScreenshots/screenshot.jpg
and it did work on WhatsApp Web, but not on the Discord Desktop Linux app :(