Browse Source

Update screenshotter script

Samuel W. Flint 1 year ago
parent
commit
00cfed4ae3
1 changed files with 16 additions and 7 deletions
  1. 16 7
      screenshot

+ 16 - 7
screenshot

@@ -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