all repos — dotfiles @ 891917c42b235ef0e572cfaf38cad6f8db006f1d

linux dotfiles

bin/scripts/log

1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/bin/sh
# life log

key="A17AFDEA2EF9A76AA868285DE2AB251EDB8945E5"
log_path=~/docs/org/lifelog/ll.gpg
tmp_file_path=/tmp/llentry
l="$(printf '' | dmenu)"
date="$(date "+%Y-%m-%d %H:%M:%S")"
[ "$l" = "" ] && exit
printf '%s\t%s\n' "$date" "$l" | cat <(gpg -d $log_path 2>/dev/null || exit) - > $tmp_file_path
gpg --yes -r $key -o $log_path -e $tmp_file_path
# printf '%s\t%s\n' "$date" "$l" > $tmp_file_path
rm $tmp_file_path
# cd `dirname $log_path` && git commit -am "lifelog commit" && git push