119 lines
2.1 KiB
Bash
Executable File
119 lines
2.1 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
working_directory=$(date +%Y-%m-%d)
|
|
human_readable=$(date "+%d %b %Y")
|
|
|
|
cd ~/annex/briefs/
|
|
mkdir "$working_directory"
|
|
cd "$working_directory"
|
|
|
|
cat > main.tex <<EOF
|
|
\documentclass[oneside]{article}
|
|
|
|
\usepackage{amssymb}
|
|
\usepackage[left=1.5cm, right=1.5cm, top=1.5cm, bottom=1.5cm]{geometry}
|
|
|
|
\pagenumbering{gobble}
|
|
|
|
\begin{document}
|
|
|
|
\noindent {\Large Ryan Marina} \hspace{\fill} {\Large Briefing for $human_readable}
|
|
|
|
\noindent \textsc{Internal Document System} \hspace{\fill} $ \square $ \textit{scanned?} $ \square $ \textit{not scanned?}
|
|
|
|
\noindent \textit{Digital Archive Supplement} \hspace{\fill} internal notes: \rule{3cm}{0.4pt}
|
|
|
|
\noindent \texttt{iref:annex/briefs/$working_directory}
|
|
|
|
\vspace{0.4cm}
|
|
|
|
\noindent \textsc{Schedule}
|
|
|
|
\vspace{-0.30cm}
|
|
|
|
\noindent \rule{\textwidth}{0.4pt}
|
|
|
|
EOF
|
|
|
|
schedule=$(
|
|
khal list today today --format "{calendar}|{categories}|{start-time}|{end-time}|{title}" |
|
|
grep -E '^home\|school\||band\|'
|
|
)
|
|
IFS='
|
|
'
|
|
|
|
for class in $schedule; do
|
|
echo "$class" |
|
|
awk -F'|' '{
|
|
print "\\noindent " $5 " \\hspace{\\fill} \\textit{(" $3 "-" $4 ")}\n\n"
|
|
}' >> main.tex
|
|
done
|
|
|
|
cat >> main.tex <<EOF
|
|
\vspace{0.4cm}
|
|
|
|
\noindent \textsc{Unresolved Items}
|
|
|
|
\vspace{-0.30cm}
|
|
|
|
\noindent \rule{\textwidth}{0.4pt}
|
|
|
|
|
|
EOF
|
|
|
|
todo_items=$(
|
|
todo --porcelain |
|
|
jq -r '.[].summary'
|
|
)
|
|
IFS='
|
|
'
|
|
|
|
for todo in $todo_items; do
|
|
printf '\\noindent $ \\square $ %s\n\n' "$todo" >> main.tex
|
|
done
|
|
|
|
cat >> main.tex <<EOF
|
|
\vspace{0.4cm}
|
|
|
|
EOF
|
|
|
|
# generate notices
|
|
ssh netbox df -h |
|
|
grep /dev/vda3 |
|
|
awk -F' ' '{print "\\item \\texttt{" $1 "} on \\texttt{netbox} is at " $5 " utilization."}' |
|
|
sed 's/\%/\\%/g' > notices.tex
|
|
|
|
if [ -f notices.tex ]; then
|
|
cat >> main.tex <<EOF
|
|
\noindent \textsc{Procedural Notices}
|
|
|
|
\vspace{-0.30cm}
|
|
|
|
\noindent \rule{\textwidth}{0.4pt}
|
|
|
|
\begin{enumerate}
|
|
|
|
\input{notices}
|
|
|
|
\end{enumerate}
|
|
|
|
\vspace{0.4cm}
|
|
EOF
|
|
fi
|
|
|
|
cat >> main.tex <<EOF
|
|
\noindent \textsc{Items to be Appended to the Agenda}
|
|
|
|
\vspace{-0.30cm}
|
|
|
|
\noindent \rule{\textwidth}{0.4pt}
|
|
|
|
\end{document}
|
|
EOF
|
|
|
|
pdflatex main.tex
|
|
|
|
printf "[!] briefing generated\n"
|
|
|
|
printf "file:///home/usr/annex/briefs/%s/main.pdf\n" "$working_directory"
|