dotfiles

My dotfiles for Arch Linux
git clone git://git.janispagel.de/dotfiles.git
Log | Files | Refs | README

commit 236f9431e1f3a001e9e4a4e61a71ab520c22c0fa
parent 08da32eedcf76f74a4a59b51ec9a37b92c46053b
Author: Janis Pagel <janis.pagel@ims.uni-stuttgart.de>
Date:   Tue, 10 Nov 2020 16:12:13 +0100

Add simple notetaking

Also automatically convert all wiki entries to pdf

Diffstat:
Abin/.local/bin/most_recent_note.sh | 3+++
Abin/.local/bin/notetaker | 13+++++++++++++
Abin/.local/bin/wikientry2pdf | 12++++++++++++
Ascripts/.local/scripts/wiki2pdf.sh | 5+++++
4 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/bin/.local/bin/most_recent_note.sh b/bin/.local/bin/most_recent_note.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +ls -r $XDG_DATA_HOME/vimwiki/pdf/note-*.pdf | head -n1 | xargs zathura diff --git a/bin/.local/bin/notetaker b/bin/.local/bin/notetaker @@ -0,0 +1,13 @@ +#!/bin/sh + +noteFilename="$XDG_DATA_HOME/vimwiki/note-$(date +%Y-%m-%d).wiki" +if [ ! -f $noteFilename ]; then + echo "= Notes for $(date +%Y-%m-%d) =" > $noteFilename +fi + +nvim -c "set formatoptions-=cro" \ + -c "norm Go" \ + -c "norm Go== $(date +%H:%M) ==" \ + -c "norm G2o" \ + -c "norm zz" \ + -c "startinsert" $noteFilename diff --git a/bin/.local/bin/wikientry2pdf b/bin/.local/bin/wikientry2pdf @@ -0,0 +1,12 @@ +#!/bin/sh + +filename=$1 +target="$(dirname "${filename}")/pdf" +outputFile="$(basename "$filename" .wiki).pdf" +mkdir -p $target +pandoc \ + -f vimwiki \ + -t pdf \ + --pdf-engine=xelatex \ + -V "geometry:margin=1in" \ + -o "$target/$outputFile" $filename & diff --git a/scripts/.local/scripts/wiki2pdf.sh b/scripts/.local/scripts/wiki2pdf.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +export WIKIPATH="$XDG_DATA_HOME/vimwiki/" +mkdir -p "$WIKIPATH"/pdf +find "$WIKIPATH" -iname "*.wiki" -type f -exec sh -c 'pandoc -f markdown -t pdf --pdf-engine=xelatex -V "geometry:margin=1in" "${0}" -o "$WIKIPATH/pdf/$(basename ${0%.wiki}.pdf)"' {} \;