config

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

commit 6cd75230f261f3922b910fd92fc1fb449c0cfecf
parent 12eaac7cb9103340c644ce7f9b20e4ddbfd3c43f
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Mon, 12 Apr 2021 21:27:45 -0700

Rework stream mupdf(1) script

The mupdf script was fixed and renamed to smp. Since mupdf(1)
determines file types by the file's name an argument is now required
to tell mupdf which type it is. Also, the mups script because I
don't often use it.

Diffstat:
Dlocal/bin/.local/bin/mupdf | 10----------
Dlocal/bin/.local/bin/mups | 7-------
Alocal/bin/.local/bin/smp | 13+++++++++++++
3 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/local/bin/.local/bin/mupdf b/local/bin/.local/bin/mupdf @@ -1,10 +0,0 @@ -#!/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,7 +0,0 @@ -#!/bin/sh -# Copyright 2021 Jacob R. Edwards -# License: GPLv3 -# -# mups -- view PostScript with mupdf(1) - -ps2pdf - | mupdf "$@" diff --git a/local/bin/.local/bin/smp b/local/bin/.local/bin/smp @@ -0,0 +1,13 @@ +#!/bin/sh -eu +# Copyright 2021 Jacob R. Edwards +# License: GPLv3 +# +# smp -- stream mupdf(1) + +cleanup() rm -f "$tmp" + +tmp="$(mktemp -t mupdf-XXXXXXXXXX).$1" +trap cleanup 0 +cat >"$tmp" +shift +mupdf "$@" "$tmp"