|
@@ -13,7 +13,7 @@ done
|
|
|
|
|
|
TYPE=root
|
|
TYPE=root
|
|
|
|
|
|
-while getopts rwf:? opt
|
|
|
|
|
|
+while getopts rwsf:? opt
|
|
do
|
|
do
|
|
case "$opt" in
|
|
case "$opt" in
|
|
r)
|
|
r)
|
|
@@ -22,18 +22,27 @@ do
|
|
w)
|
|
w)
|
|
TYPE=window
|
|
TYPE=window
|
|
;;
|
|
;;
|
|
|
|
+ s)
|
|
|
|
+ TYPE=select
|
|
|
|
+ ;;
|
|
f)
|
|
f)
|
|
FILENAME="$OPTARG"
|
|
FILENAME="$OPTARG"
|
|
;;
|
|
;;
|
|
[?])
|
|
[?])
|
|
- echo "screenshot [ -? ] [ -r | -w ] [ -f filename.png ]" >&2
|
|
|
|
|
|
+ echo "screenshot [ -? ] [ -r | -w | -s ] [ -f filename.png ]" >&2
|
|
exit 1
|
|
exit 1
|
|
;;
|
|
;;
|
|
esac
|
|
esac
|
|
done
|
|
done
|
|
|
|
|
|
-if [[ $TYPE == "root" ]] ; then
|
|
|
|
- import -window root "${FILENAME}"
|
|
|
|
-else
|
|
|
|
- import "${FILENAME}"
|
|
|
|
-fi
|
|
|
|
|
|
+case $TYPE in
|
|
|
|
+ root)
|
|
|
|
+ scrot "${FILENAME}"
|
|
|
|
+ ;;
|
|
|
|
+ window)
|
|
|
|
+ scrot -b -u "${FILENAME}"
|
|
|
|
+ ;;
|
|
|
|
+ select)
|
|
|
|
+ scrot -s "${FILENAME}"
|
|
|
|
+ ;;
|
|
|
|
+esac
|