|
@@ -13,7 +13,7 @@ done
|
|
|
|
|
|
TYPE=root
|
|
|
|
|
|
-while getopts rwf:? opt
|
|
|
+while getopts rwsf:? opt
|
|
|
do
|
|
|
case "$opt" in
|
|
|
r)
|
|
@@ -22,18 +22,27 @@ do
|
|
|
w)
|
|
|
TYPE=window
|
|
|
;;
|
|
|
+ s)
|
|
|
+ TYPE=select
|
|
|
+ ;;
|
|
|
f)
|
|
|
FILENAME="$OPTARG"
|
|
|
;;
|
|
|
[?])
|
|
|
- echo "screenshot [ -? ] [ -r | -w ] [ -f filename.png ]" >&2
|
|
|
+ echo "screenshot [ -? ] [ -r | -w | -s ] [ -f filename.png ]" >&2
|
|
|
exit 1
|
|
|
;;
|
|
|
esac
|
|
|
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
|