X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=bin%2Fcapture-window.sh;h=126b8e4d41c780b7f23b910d3429fa250889adab;hb=10b78beac53843192f7da8a6dbaa2d5e0572b307;hp=ce75bdd546d62457df6b2c590f4909dccb2aa2f2;hpb=952fd00c5d159096c407be3fc57acf62921eabf6;p=clearscm.git diff --git a/bin/capture-window.sh b/bin/capture-window.sh index ce75bdd..126b8e4 100755 --- a/bin/capture-window.sh +++ b/bin/capture-window.sh @@ -1,2 +1,17 @@ #!/bin/bash -gnome-screenshot -cwf /System/tmp/Screenshots/$(date +%F@%T).png +timeout=10 +screenshot_directory=/tmp + +function yesno { + question=$1 + + zenity --question --text "$question" --width=300 --timeout=$timeout 2> /dev/null +} + +mate-screenshot -wc + +file=$screenshot_directory/Screenshots/$(date +%F@%T).png + +if yesno "Save screenshot as $file?"; then + xclip -selection clipboard -t image/png -o > $file +fi