Permalink
Cannot retrieve contributors at this time
Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up
Fetching contributors…
| #!/bin/sh | |
| # Personal notebook script | |
| set -e | |
| DDIR="$HOME/Sync/pvw" | |
| if [ ! -d "$DDIR" ] | |
| then | |
| exit 1 | |
| fi | |
| cd "$DDIR" | |
| TALKABOUT=" | |
| Erzähl mir etwas was dich kürzlich glücklich gemacht hat! | |
| Erzähl mir etwas worauf du stolz bist! | |
| Erzähl mir von einem guten Menschen! | |
| Erzähl mir von einer tollen Stadt! | |
| Erzähl mir von einem schönen Urlaub! | |
| Erzähl mir eine Sache die auf deiner Löffelliste steht! | |
| Was hast du in der letzten Woche gelernt? | |
| Was motiviert dich? | |
| Machst du genug Fehler? | |
| Was würdest du gerne ändern kannst es aber nicht? | |
| Was erhoffst du dir im nächsten halben Jahr? | |
| Was wird sich auch in 10 Jahren nicht geändert haben? | |
| Was erhoffst du dir in 5 Jahren?" | |
| case $1 in | |
| recently) # least recently modified | |
| ls -t -1 | |
| ;; | |
| remind) # echo reminder if last journal is too long ago | |
| YEAR=$(date +%Y) | |
| FILE=$(ls -t -1 $YEAR/$YEAR* | head -1) | |
| MTIME=$(stat -c %Y $FILE) | |
| NOW=$(date +%s) | |
| DIFF=$(( ($NOW - $MTIME) / 60 )) | |
| # if more than 90 minutes then remind | |
| if [ $DIFF -gt 90 ] | |
| then | |
| echo "journal?" | |
| else | |
| exit 1 | |
| fi | |
| ;; | |
| skip-remind) # make reminder disappear for a little | |
| YEAR=$(date +%Y) | |
| FILE=$(ls -t -1 $YEAR/$YEAR* | head -1) | |
| touch $FILE | |
| ;; | |
| journal) # add journal entry for today | |
| FILE=$(date +%Y/%Y-%m-%d) | |
| mkdir -p $(dirname "$FILE") | |
| PREV=$(date --date="yesterday" +%Y/%Y-%m-%d) | |
| if [ ! -f "$FILE" ] | |
| then | |
| echo >>$FILE "Wichtigste Aufgabe heute: " | |
| #echo >>$FILE "Ich war glücklich als: " | |
| #echo >>$FILE "Gestern Zahnseide benutzt? " | |
| #echo >>$FILE "Gestern an Diss gearbeitet? " | |
| if [ -f "$PREV" ] | |
| then | |
| JOB=$(cat "$PREV" | head -n 1 | cut -d ':' -f 2- | sed -e 's/^ *//' -e 's/ *$//') | |
| echo >>$FILE "Gestern \"$JOB\" erledigt? " | |
| fi | |
| echo "$TALKABOUT" | shuf -n1 >>$FILE | |
| fi | |
| echo >>$FILE | |
| echo $(date +%H:%M\ %:z) >>$FILE | |
| echo >>$FILE | |
| vim $FILE | |
| ;; | |
| yesterday) # edit journal entry for yesterday | |
| FILE=$(date -d yesterday +%Y/%Y-%m-%d) | |
| if [ ! -f "$FILE" ] | |
| then | |
| echo "Kein Eintrag gestern" | |
| exit 1 | |
| fi | |
| vim $FILE | |
| ;; | |
| *) # start at main page | |
| vim main | |
| ;; | |
| esac |