lyx_mirror/lib/scripts/lyxpaperview

27 lines
707 B
Plaintext
Raw Normal View History

#!/bin/bash
#This is just an example of an external script for finding corresponding file to the citation of the form Author + Year.
#You will need to accomodate it to your particular situation.
#
2020-08-21 07:25:10 +00:00
#Syntax: paperview Year Author
#Output: absolute path to the file(s)
#
2020-08-21 01:51:06 +00:00
#Dependencies:
#1) mlocate/updatedb or similar package installed and running.
#2) stored papers must contain first author name and year of publication in filename.
VIEWER=qpdfview
MAX_RESULTS=2
name="$2"
year="$1"
if [ -z "$name" ]; then exit; fi
FILE=`locate -i "$name" | grep -Ei '\.pdf$|\.ps$' | grep "$year" | head -n $MAX_RESULTS`
#Putting in background necessary so that LyX does not wait for viewer to end
$VIEWER ${FILE} &