截图后将图片添加到粘贴板

This commit is contained in:
2022-08-15 11:59:45 +08:00
parent b07d7bebdb
commit 561312f2f0

View File

@@ -1,7 +1,12 @@
#!/bin/sh
timestamp="$(date +%Y%m%d%H%M%S)"
targetbase="$HOME/screenshots"
mkdir -p $targetbase
TIMESTAMP="$(date +%Y%m%d%H%M%S)"
TARGETBASE="$HOME/screenshots"
mkdir -p $TARGETBASE
FILENAME="$TARGETBASE/${TIMESTAMP}.png"
[ -d $targetbase ] || exit 1
scrot -s $targetbase/$timestamp.png
scrot -s $FILENAME
if [[ -n $(type -p xclip) ]]; then
xclip -selection clipboard -t image/png $FILENAME
fi