#!/bin/sh
rm /tmp/cliprect.png
ssh [email protected] "DISPLAY=:0 xclip -selection clipboard -t image/png -o -" > /tmp/cliprect.png
if [ $? -eq 1 ]; then
notify-send -t 10000 "failed getting png from remote machine"
else
xclip -selection clipboard -t image/png -i /tmp/cliprect.png
fi
The image on the clipboard of the remote machine will be on the clipboard of yours, you can just directly paste it.
Available under MIT license. Only use after understanding all the commands. /tmp/cliprect.png
will be deleted if the script is ran.