commit 7d9b5bf3094673bfe8fc061d47ccc8f7d2778672 parent e74cf9ae2b83ade0f176a55aa6168c0699633609 Author: Pablo Cárdenas <pablo.cardenas@imca.edu.pe> Date: Mon, 16 May 2022 15:28:17 -0500 Added bibopen script Diffstat:
| A | linux/.local/bin/bib/main.pl | | | 19 | +++++++++++++++++++ |
| A | linux/.local/bin/bibopen | | | 1 | + |
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/linux/.local/bin/bib/main.pl b/linux/.local/bin/bib/main.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use diagnostics; + +use Text::BibTeX; + +my $bibfile = Text::BibTeX::File->new('/home/pablo/Documents/references/references.bib'); +my $entry; + +while ($entry = Text::BibTeX::Entry->new($bibfile)) { + next unless $entry->parse_ok; + next unless $entry->metatype eq BTE_REGULAR; + my $key = $entry->key; + my $title = $entry->get('title'); + my $author = $entry->get('author'); + print "$key - $title - $author\n"; +} diff --git a/linux/.local/bin/bibopen b/linux/.local/bin/bibopen @@ -0,0 +1 @@ + ~/.local/bin/bib/main.pl | dmenu -i -l 20 | cut -d" " -f1 | xargs -r -I {} zathura $HOME/Documents/references/{}.pdf