aboutsummaryrefslogtreecommitdiff
path: root/open-stdin
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-12-23 10:01:15 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2024-12-23 10:01:15 +0100
commit7d3dc968b6183f51dc2594c80450372f0c8fb811 (patch)
tree955b6be59884229125a63f070e16992dc5a79ca1 /open-stdin
parent20bbe3418e71556ff2d14623cbbf047c0bd55855 (diff)
downloadscripts-7d3dc968b6183f51dc2594c80450372f0c8fb811.tar.gz
scripts-7d3dc968b6183f51dc2594c80450372f0c8fb811.zip
Changes for new laptop
Diffstat (limited to '')
-rwxr-xr-xopen-stdin8
1 files changed, 4 insertions, 4 deletions
diff --git a/open-stdin b/open-stdin
index 5c0ee1e..a1e10b5 100755
--- a/open-stdin
+++ b/open-stdin
@@ -1,12 +1,12 @@
1#!/bin/sh 1#!/bin/sh
2 2
3# Saves standard input in a download folder and opens it (spawn) 3# Saves standard input in a temporary file and opens it (spawn)
4# Usage: open-stdin 4# Usage: open-stdin
5# Requires: open-file 5# Requires: open-file (or set $OPENER to e.g. xdg-open)
6 6
7#folder=$HOME/Downloads/open-stdin
8folder=${TMPDIR:-/tmp} 7folder=${TMPDIR:-/tmp}
8open=${OPENER:-open-file}
9 9
10tempfile=$(mktemp -p "$folder") 10tempfile=$(mktemp -p "$folder")
11 11
12cat > "$tempfile" && open-file $@ "$tempfile" 12cat > "$tempfile" && $open $@ "$tempfile"

Generated with cgit - Back to sebastiano.tronto.net