/
mom
executable file
·126 lines (106 loc) · 4.28 KB
/
mom
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/bin/bash
audio_recording=0
agenda=0
usage () {
echo "$0 [-h] [-n]"
echo ""
echo " -h: display this help"
echo " -a: audio recording. This option will start the audio for"
echo " audio recording (mp3 format)."
echo ""
exit 0
}
while getopts ":ha" opt; do
case $opt in
h)
usage
;;
a)
audio_recording=1
;;
\?)
echo "Invalid option: $OPTARG" >&2
exit 1
;;
esac
done
date=$( date '+%Y-%m-%d_%H:%M' )
projects=$( find /home/gsacre/projects/ -maxdepth 1 -type d | sed 's!/home/gsacre/projects/!!g' | sort )
echo "Please enter the project name: "
index=0
declare -a list_of_proj
for proj in $projects; do
list_of_proj=( "${list_of_proj[@]}" "$index-$proj" )
if [ $index -lt 10 ]; then
echo "$index ) $proj"
else
echo "$index) $proj"
fi
index=$(( $index + 1 ))
done
echo ""
echo -n "Your choice: "
read choice
if [ ${#choice} -lt 1 ]; then
proj_chosen=misc
else
proj_chosen=$( echo ${list_of_proj[$choice]} | awk -F '-' '{ print $2; }' )
fi
echo
echo "You have chosen the project: $proj_chosen"
echo
echo -n "Please enter the context of the meeting: "
read context
git clone /home/gsacre/SpiderOak/SK-Minutes_of_Meeting "/home/gsacre/projects/${proj_chosen}/mom/${context}_-_${date}" >/dev/null &
echo ""
echo -n "Please enter the location: [Conference call] "
read location
echo ""
echo "Confidentiality level:"
echo "1) Confidential"
echo "2) Under NDA"
echo "3) Internal purpose only"
echo -n "Please enter the confidentiality level: "
read confidentiality
sound_card=$( ls /sys/class/sound/ | grep card )
context_escaped="`echo $context | tr ' ' '_'`"
sed -i "s/NAME=SK-template/NAME=${context_escaped}/g" "/home/gsacre/projects/${proj_chosen}/mom/${context}_-_${date}/Makefile"
sed -i "s/Title{Purpose of the meeting}/Title{${context}}/g" "/home/gsacre/projects/${proj_chosen}/mom/${context}_-_${date}/SK-template.tex"
sed -i "s/Location{Location of the meeting \/ Conference Call}/Location{${location}}/g" "/home/gsacre/projects/${proj_chosen}/mom/${context}_-_${date}/SK-template.tex"
case $confidentiality in
1)
echo level 1
sed -i "s!Confidentiality{Confidential/Under NDA/Internal purpose only}!Confidentiality{Confidential}!g" "/home/gsacre/projects/${proj_chosen}/mom/${context}_-_${date}/SK-template.tex"
;;
2)
echo level 2
sed -i "s!Confidentiality{Confidential/Under NDA/Internal purpose only}!Confidentiality{Under NDA}!g" "/home/gsacre/projects/${proj_chosen}/mom/${context}_-_${date}/SK-template.tex"
;;
3)
echo level 3
sed -i "s!Confidentiality{Confidential/Under NDA/Internal purpose only}!Confidentiality{Internal purpose only}!g" "/home/gsacre/projects/${proj_chosen}/mom/${context}_-_${date}/SK-template.tex"
;;
esac
gvim --servername mom --remote-tab-silent "/home/gsacre/projects/${proj_chosen}/mom/${context}_-_${date}/minutes.tex"
sleep 0.5
gvim --servername mom --remote-tab-silent "/home/gsacre/projects/${proj_chosen}/mom/${context}_-_${date}/ongoing.tex"
sleep 0.5
gvim --servername mom --remote-tab-silent "+/& Gregory & GSA/<CR>" "/home/gsacre/projects/${proj_chosen}/mom/${context}_-_${date}/SK-template.tex"
echo "MoM path: /home/gsacre/projects/${proj_chosen}/mom/${context}_-_${date}"
if [ $audio_recording -eq 1 ]; then
if [ $( ls /sys/class/sound/ | grep card | wc -l ) -eq 1 ] && [ $( echo $sound_card | grep 0 | wc -l ) -gt 0 ]; then
echo "Sound cards 0 found!"
/usr/bin/arecord -f S32_LE -r48000 -c2 -D hw:0 "/home/gsacre/projects/${proj_chosen}/mom/audio/${context}_-_${date}.wav"
elif [ $( ls /sys/class/sound/ | grep card | wc -l ) -eq 1 ] && [ $( echo $sound_card | grep 1 | wc -l ) -gt 0 ]; then
echo "Sound cards 1 found!"
/usr/bin/arecord -f S32_LE -r48000 -c2 -D hw:1 "/home/gsacre/projects/${proj_chosen}/mom/audio/${context}_-_${date}.wav"
elif [ $( ls /sys/class/sound/ | grep card | wc -l ) -gt 1 ]; then
echo "Two sound cards found!"
/usr/bin/arecord -f S32_LE -r48000 -c2 -D hw:0 "/home/gsacre/projects/${proj_chosen}/mom/audio/${context}_-_${date}.wav"
fi
cd "/home/gsacre/projects/${proj_chosen}/mom/audio"
for files in *.wav; do
/usr/bin/lame --alt-preset extreme "$files" "`basename \"$files\" wav`mp3"
done
/bin/rm *.wav
fi