Merge branch 'master' of git+ssh://github.com/adefaria/clearscm
[clearscm.git] / bin / capture-window.sh
index 46ad937..4a859c2 100755 (executable)
@@ -1,2 +1,18 @@
 #!/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
+aplay ~/Conf/CameraClick.wav
+
+file="$screenshot_directory/$(date +%F@%T).png"
+
+if yesno "Save screenshot as $file?"; then
+  xclip -selection clipboard -t image/png -o > $file
+fi