X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=bin%2Fcapture-area.sh;h=d00d4a1e45be152bc29a3a0fff6a305f658fb95f;hb=2f62d48c53bb2a488e34cf5ae31871a93763f9a2;hp=4ed0f95ed680ab3f2802bd2c3b7b55ad4211cba9;hpb=240ca5b4d23823ef2ac8b65c34cb7bc39a81bd5c;p=clearscm.git diff --git a/bin/capture-area.sh b/bin/capture-area.sh index 4ed0f95..d00d4a1 100755 --- a/bin/capture-area.sh +++ b/bin/capture-area.sh @@ -1,2 +1,20 @@ #!/bin/bash -gnome-screenshot -caf /System/tmp/Screenshot-$(date +%F@%T).png +# +# Apparently using png screws up sometimes so let's try using good old jpg +timeout=10 +screenshot_directory=/tmp + +function yesno { + question=$1 + + zenity --question --text "$question" --width=300 --timeout=$timeout 2> /dev/null +} + +mate-screenshot --area --clipboard +aplay ~/Conf/CameraClick.wav + +file="$screenshot_directory/$(date +%F@%T).jpg" + +if yesno "Save screenshot as $file?"; then + xclip -selection clipboard -t image/jpeg -o > $file +fi