Last active
August 3, 2018 03:07
-
-
Save JichunMa/f11c947513014581c043f34f539e6093 to your computer and use it in GitHub Desktop.
shell 命令执行截图保存桌面(支持自动删除)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
dir=~/Desktop/screenshot/ | |
curr=`date "+%Y-%m-%d %H:%M:%S"` | |
name=${dir}"screenshot"${curr}".png" | |
echo "${name}" | |
adb exec-out screencap -p > "$name" | |
if [ -n "$1" ]; then | |
echo "$1 秒后自动删除" | |
sleep $1 | |
rm "$name" | |
else | |
echo "永久保存" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
试用了一下感觉非常棒,非常好的解决了我需要经常截图的需求,点赞