1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-10-09 19:11:15 +02:00

adding all important config files

This commit is contained in:
tiynger
2019-09-13 10:51:43 +02:00
parent f53c29bd51
commit 7db8c1ec4b
54 changed files with 5317 additions and 0 deletions

14
.local/bin/tools/getbib Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/sh
[ -z "$1" ] && echo "Give either a pdf file or a DOI as an argument." && exit
if [ -f "$1" ]; then
# Try to get DOI from pdfinfo or pdftotext output.
doi=$(pdfinfo "$1" | grep -io "doi:.*") ||
doi=$(pdftotext "$1" 2>/dev/null - | grep -io "doi:.*" -m 1) ||
exit 1
else
doi="$1"
fi
# Check crossref.org for the bib citation.
curl -s "http://api.crossref.org/works/$doi/transform/application/x-bibtex" -w "\\n"