-
Notifications
You must be signed in to change notification settings - Fork 0
/
rec
33 lines (27 loc) · 826 Bytes
/
rec
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
33
# ~/zfuncs/rec
# Record
# Use asciinema to record terminal output to $ASCIINEMA_DIR
__rec() {
echo "Record: Use asciinema to record terminal output to $ASCIINEMA_DIR";
echo "-----------";
read "filename?Filename:"
if [ -z "$filename" ]
then
echo "Filename is empty string, aborting"
return 1;
fi
echo "Will record to: $ASCIINEMA_DIR/$filename.cast"
echo "-------"
read "reply?Continue (y/n)?"
if [[ $reply =~ ^[Yy]$ ]]
then
asciinema rec "$ASCIINEMA_DIR/$filename.cast"
agg "$ASCIINEMA_DIR/$filename.cast" "$ASCIINEMA_DIR/$filename.gif"
echo "Created: \n $ASCIINEMA_DIR/$filename.cast \n $ASCIINEMA_DIR/$filename.gif"
else
echo "User cancelled recording"
fi
echo "-----------";
echo "Recording Complete";
}
__rec