-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathbyzanz-screencapture-monitor2.sh
More file actions
executable file
·42 lines (33 loc) · 1.04 KB
/
byzanz-screencapture-monitor2.sh
File metadata and controls
executable file
·42 lines (33 loc) · 1.04 KB
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
34
35
36
37
38
39
40
41
42
#!/bin/bash
# @author Ryan McIntyre
# references:
# http://stackoverflow.com/questions/2642585/read-a-variable-in-bash-with-a-default-value
# default to 10
read -p "Duration of seconds to run (enter for default of 10): " DURATION
DURATION=${DURATION:-10}
echo $DURATION
# default to 1920
read -p "X position (enter for default of 1920): " XPOS
XPOS=${XPOS:-1920}
echo $XPOS
# default to 0
read -p "Y position (enter for default of 0): " YPOS
YPOS=${YPOS:-0}
echo $YPOS
# default to 1920
read -p "Width (enter for default of 1920): " WIDTH
WIDTH=${WIDTH:-1920}
echo $WIDTH
# default to 1
read -p "Delay (enter for default of 1): " DELAY
DELAY=${DELAY:-1}
echo $DELAY
OUTDIR=~/Screencasts/byzanz
# e.g. 29-Apr-2014-07:31:31 PM
DATE=$(date +"%d-%b-%Y-%r")
# check if directory doesn't exist and not linked file
if [[ ! -d "${DESTINATION_DIR}" && ! -L "${DESTINATION_DIR}" ]] ; then
mkdir -p $OUTDIR
fi
byzanz-record --duration=$DURATION --x=$XPOS --y=$YPOS --width=$WIDTH --delay=$DELAY "$OUTDIR/screencast_$DATE.gif"
thunar $OUTDIR