Rsync Mikey & Kent
[clearscm.git] / bin / capture-window.sh
index ce75bdd..21270cf 100755 (executable)
@@ -1,2 +1,22 @@
 #!/bin/bash
-gnome-screenshot -cwf /System/tmp/Screenshots/$(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
+}
+
+sleep 1
+
+gnome-screenshot --window --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