config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit eb71a76257814ac890207d632cb199b00200a294
parent 6300ffd48f89b5d675b405fdb6acdb4cc4d85c5f
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Thu,  8 Apr 2021 23:19:26 -0700

Make a mupdf(1) wrapper script to use stdin

This script writes it's input into a temporary file and invokes
mupdf(1) on it. The mups script was also updated since most of what
it did is done in the new script.

Diffstat:
Alocal/bin/.local/bin/mupdf | 10++++++++++
Mlocal/bin/.local/bin/mups | 7++-----
2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/local/bin/.local/bin/mupdf b/local/bin/.local/bin/mupdf @@ -0,0 +1,10 @@ +#!/bin/sh -e +# Copyright 2021 Jacob R. Edwards +# License: GPLv3 +# +# mupdf -- view files with mupdf(1) from stdin + +tmp="$(mktemp -t mupdf-XXXXXXXXXX)" +trap "rm -f $tmp" 0 +cat >"$tmp" +$(whereis mupdf) "$@" "$tmp" diff --git a/local/bin/.local/bin/mups b/local/bin/.local/bin/mups @@ -1,10 +1,7 @@ -#!/bin/sh -e +#!/bin/sh # Copyright 2021 Jacob R. Edwards # License: GPLv3 # # mups -- view PostScript with mupdf(1) -tmp="$(mktemp -t mups-XXXXXXXXXX)" -trap "rm -f $tmp" 0 -ps2pdf - >"$tmp" -mupdf "$@" "$tmp" +ps2pdf - | mupdf