-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecord-window
More file actions
executable file
·32 lines (27 loc) · 850 Bytes
/
Copy pathrecord-window
File metadata and controls
executable file
·32 lines (27 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# Delay before starting
DELAY=5
# Sound notification to let one know when recording is about to start (and ends)
beep() {
aplay /usr/share/sounds/pop.wav &
}
# Duration and output file
if [ $# -gt 0 ]; then
D="--duration=$@ windowcap.gif"
else
echo Default recording duration 10s to windowcap.gif
D="--duration=10 windowcap.gif"
fi
XWININFO=$(xwininfo)
read X < <(awk -F: '/Absolute upper-left X/{print $2}' <<< "$XWININFO")
read Y < <(awk -F: '/Absolute upper-left Y/{print $2}' <<< "$XWININFO")
read W < <(awk -F: '/Width/{print $2}' <<< "$XWININFO")
read H < <(awk -F: '/Height/{print $2}' <<< "$XWININFO")
echo Delaying $DELAY seconds. After that, byzanz will start
for (( i=$DELAY; i>0; --i )) ; do
echo $i
sleep 1
done
beep
byzanz-record --verbose --delay=0 --x=$X --y=$Y --width=$W --height=$H $D
beep