dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit dc1618413eb2f29d7f2da746fe776f88dbce200b
parent 427358632d8d37fa90f09f4089e4202fa2a10e44
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Wed, 12 Jun 2019 21:14:24 +0200

Add pdfview script for nnn

Diffstat:
A.config/nnn/plugins/pdfview | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/.config/nnn/plugins/pdfview b/.config/nnn/plugins/pdfview @@ -0,0 +1,12 @@ +#!/usr/bin/env sh + +# Description: View a PDF file in pager +# +# Shell: POSIX compliant +# Author: Arun Prakash Jana + +if ! [ -z "$1" ]; then + if [ $(head -c 4 "$1") = "%PDF" ]; then + pdftotext -nopgbrk -layout "$1" - | sed 's/\xe2\x80\x8b//g' | $PAGER + fi +fi