aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorGravatar Matheus R <matheusrbarros03@gmail.com> 2021-10-27 23:23:38 +0000
committerGravatar Matheus R <matheusrbarros03@gmail.com> 2021-10-27 23:23:38 +0000
commitc3995217392eab7ac159793ae80e3d1e7c1f293c (patch)
tree265b3db02ca85defcf976d5fbfbd21f7ad136023 /bin
parent9e11797e253c8008eade3ab5ec0fa7c8d7fce010 (diff)
Adição do script para capturas de tela
Diffstat (limited to 'bin')
-rwxr-xr-x[-rw-r--r--]bin/scr.sh24
1 files changed, 21 insertions, 3 deletions
diff --git a/bin/scr.sh b/bin/scr.sh
index d1d5600..a6c95ae 100644..100755
--- a/bin/scr.sh
+++ b/bin/scr.sh
@@ -2,6 +2,24 @@
# simple script for screenshot management
-#case IFS
-#
-#"sleep 0.2; scrot -s -f '%Y-%m-%d_$wx$h.png' -e 'mv $f /home/math/Imagens/Prints'"
+[ -d "/tmp/prints" ] || mkdir -p "/tmp/prints"
+
+file='%Y-%m-%d_$wx$h.png'
+
+[ "$#" -lt 1 ] && echo "not enough arguments" && exit 1
+
+if [ "$1" = "-s" ] || [ "$1" = "--selection" ]
+then
+ sleep 0.2 && scrot -sf "$file" -e 'mv $f "/tmp/prints"'
+
+elif [ "$1" = "-a" ] || [ "$1" = "--active-window" ]
+then
+ sleep 0.2 && scrot -u "$file" -e 'mv $f "/tmp/prints"'
+
+elif [ "$1" = "-w" ] || [ "$1" = "--whole-screen" ]
+then
+ sleep 0.2 && scrot "$file" -e 'mv $f "/tmp/prints"'
+
+else
+ echo "option not recognized"
+fi