From 60052659b98832c78c902e4f27ecee2663d8e913 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Wed, 6 May 2026 08:30:49 +0200 Subject: Added scripts --- scripts/open-stdin | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 scripts/open-stdin (limited to 'scripts/open-stdin') diff --git a/scripts/open-stdin b/scripts/open-stdin new file mode 100755 index 0000000..a1e10b5 --- /dev/null +++ b/scripts/open-stdin @@ -0,0 +1,12 @@ +#!/bin/sh + +# Saves standard input in a temporary file and opens it (spawn) +# Usage: open-stdin +# Requires: open-file (or set $OPENER to e.g. xdg-open) + +folder=${TMPDIR:-/tmp} +open=${OPENER:-open-file} + +tempfile=$(mktemp -p "$folder") + +cat > "$tempfile" && $open $@ "$tempfile" -- cgit v1.3