Fix pdf compilation targets and Library envvar

Pdfs will be compiled, replacing special characters with underscores;
this fix also looks for underscored files when trying to open the
compiled version of a file.

The Library environment variable (for my default bibtex library
directory) overwrote yay's library directory; it has been renamed to
LIBRARYROOT to both mirror WIKIROOT as my note directory and keep the
LIBRARY variable empty so yay will continue working.
This commit is contained in:
Marty Oehme 2019-12-28 10:07:05 +01:00
parent 66cdb395aa
commit bd96394d67
2 changed files with 6 additions and 2 deletions

View file

@ -4,8 +4,8 @@
# will be picked up by vim wiki plugin as root directory
export WIKIROOT="$HOME/documents/notes/"
export LIBRARY="$HOME/documents/library"
export BIBFILE="$LIBRARY/academia/academia.bib"
export LIBRARYROOT="$HOME/documents/library"
export BIBFILE="$LIBRARYROOT/academia/academia.bib"
# these are my personal 'important' environment settings
export EDITOR=nvim

View file

@ -11,6 +11,10 @@ basename="$(echo "$1" | sed 's/\.[^\/.]*$//')"
openCompiledDoc() {
if [ -f "$basename".pdf ]; then
setsid "$FILEREADER" "$basename.pdf"
elif [ -f "$(echo "$basename" | sed 's/ /-/g')".pdf ]; then
setsid "$FILEREADER" "$(echo "$basename" | sed 's/ /-/g').pdf"
elif [ -f "$(echo "$basename" | sed 's/ /_/g')".pdf ]; then
setsid "$FILEREADER" "$(echo "$basename" | sed 's/ /_/g').pdf"
elif [ -f "$basename".html ]; then
setsid "$BROWSER" "$basename.html"
fi