#!/usr/bin/env python3
import os.path

# config for rofi-bibbrowser
# https://github.com/t-wissmann/rofi-bibbrowser

bib_dirs = [
    BibDir('~/uni/literatur/refs.bib'),
]

def tryBibDir(path):
    global bib_dirs
    if os.path.exists(os.path.expanduser(path)):
        bib_dirs.append(BibDir(path))
    else:
        print(f'path »{path}« does not exist, skipping.', file=sys.stderr)

publications_bib = os.path.expanduser('~/git/homepage/wissmann-publications.bib')
if not os.path.exists(publications_bib):
    publications_bib = '~/uni/publications/wissmann-publications.bib'
bib_dirs.append(BibDir('~/uni/publications', bib=publications_bib))

# additional directories with PDFs but without bibtex files:
additional_paths = [
    '~/git/papers/Bars-RNNA/literature',
    '~/git/papers/COAX-Literature',
    '~/git/papers/coalgpartref/literature',
]
for p in additional_paths:
    if os.path.exists(os.path.expanduser(p)):
        bib_dirs.append(BibDir(p, bib='/dev/null'))
