Changes to cedrtbot scripts
[clearscm.git] / bin / capture-window.sh
1 #!/bin/bash
2 #
3 # Apparently using png screws up sometimes so let's try using good old jpg
4 timeout=10
5 screenshot_directory=/tmp
6
7 function yesno {
8   question=$1
9   
10   zenity --question --text "$question" --width=300 --timeout=$timeout 2> /dev/null
11 }
12
13 sleep 1
14
15 gnome-screenshot --window --clipboard
16 aplay ~/Conf/CameraClick.wav
17
18 file="$screenshot_directory/$(date +%F@%T).jpg"
19
20 if yesno "Save screenshot as $file?"; then
21   xclip -selection clipboard -t image/jpeg -o > $file
22 fi