|
|
@ -0,0 +1,29 @@
|
|
|
1
|
#!/bin/bash
|
|
|
2
|
|
|
|
3
|
summary_date="${1:-$(date +%Y-%m-%d)}"
|
|
|
4
|
|
|
|
5
|
if [ "$summary_date" = "all" ]; then
|
|
|
6
|
cat ~/.work-summary.txt
|
|
|
7
|
exit $?
|
|
|
8
|
fi
|
|
|
9
|
|
|
|
10
|
if [ "$summary_date" = "catchup" ]; then
|
|
|
11
|
cut -f1 -d' ' ~/.work-log-30m | sort | uniq | xargs -I{} bash -c "grep {} ~/.work-summary.txt > /dev/null || echo {}" | xargs -I{} work-summary {}
|
|
|
12
|
exit
|
|
|
13
|
fi
|
|
|
14
|
|
|
|
15
|
summary="$(grep "$summary_date" ~/.work-summary.txt)"
|
|
|
16
|
if [ "$?" = "0" ]; then
|
|
|
17
|
echo "$summary"
|
|
|
18
|
exit 0
|
|
|
19
|
fi
|
|
|
20
|
|
|
|
21
|
summary="$(zenity --entry --text "Summary of $summary_date:\n\n$(grep "$summary_date" ~/.work-log-30m)")"
|
|
|
22
|
if [ -z "$summary" ]; then
|
|
|
23
|
exit 1
|
|
|
24
|
fi
|
|
|
25
|
|
|
|
26
|
echo -n "$summary_date -- " >> ~/.work-summary.txt
|
|
|
27
|
echo "$summary" >> ~/.work-summary.txt
|
|
|
28
|
echo >> ~/.work-log-30m
|
|
|
29
|
echo "$summary_date -- $summary"
|