X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=bin%2Fcapture-window.sh;h=126b8e4d41c780b7f23b910d3429fa250889adab;hb=fc0e2c7f3fce9e64608d0aa13399d62f24000784;hp=46ad93744c331c585237eff2e46711b9414090b7;hpb=240ca5b4d23823ef2ac8b65c34cb7bc39a81bd5c;p=clearscm.git diff --git a/bin/capture-window.sh b/bin/capture-window.sh index 46ad937..126b8e4 100755 --- a/bin/capture-window.sh +++ b/bin/capture-window.sh @@ -1,2 +1,17 @@ #!/bin/bash -gnome-screenshot -cwf /System/tmp/Screenshot-$(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