Skip to content

Instantly share code, notes, and snippets.

@JichunMa
Last active August 3, 2018 03:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JichunMa/f11c947513014581c043f34f539e6093 to your computer and use it in GitHub Desktop.
Save JichunMa/f11c947513014581c043f34f539e6093 to your computer and use it in GitHub Desktop.
shell 命令执行截图保存桌面(支持自动删除)
#! /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
@hanfeng120
Copy link

试用了一下感觉非常棒,非常好的解决了我需要经常截图的需求,点赞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment