Created
November 20, 2010 10:33
-
-
Save ninehills/707747 to your computer and use it in GitHub Desktop.
Ubuntu下的截图脚本
This file contains hidden or 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 | |
# Ubuntu下的截图脚本,为其设置一个快捷键即可 | |
# 来自:http://forum.ubuntu.org.cn/viewtopic.php?f=120&t=125239 | |
NOW=`date '+%Y-%m-%d-%H-%M-%S'` | |
if [ -z $2 ]; then | |
FNAME=screenshot-${NOW} | |
else | |
FNAME="[$2]-${NOW}" | |
fi | |
EXT=png | |
SCRDIR=${HOME}/Picture/snap/ | |
if [ ! -d "${SCRDIR}" ]; then | |
mkdir -p "${SCRDIR}" | |
fi | |
if [ -z $1 ]; then | |
cmd="import -frame ${SCRDIR}${FNAME}.${EXT}" | |
else | |
cmd="import -frame -window $1 ${SCRDIR}${FNAME}.${EXT}" | |
fi | |
eval $cmd | |
echo ${SCRDIR}${FNAME}.${EXT} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment