From bd96394d67af0566be607225af26a743929f9675 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 28 Dec 2019 10:07:05 +0100 Subject: [PATCH] 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. --- .config/shell/login.d/env-vars.sh | 4 ++-- .local/bin/open-compiled | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.config/shell/login.d/env-vars.sh b/.config/shell/login.d/env-vars.sh index b16e94e..a53e2d1 100644 --- a/.config/shell/login.d/env-vars.sh +++ b/.config/shell/login.d/env-vars.sh @@ -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 diff --git a/.local/bin/open-compiled b/.local/bin/open-compiled index 926296e..489180b 100755 --- a/.local/bin/open-compiled +++ b/.local/bin/open-compiled @@ -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