From 8b4e99e55b54b61a9b0c7063e9ee8482f99537b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 21 Nov 2020 17:41:20 +0100 Subject: Add 'xii' tool (downloads and displays X-Image images) --- xii | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 xii (limited to 'xii') diff --git a/xii b/xii new file mode 100755 index 0000000..dc4a620 --- /dev/null +++ b/xii @@ -0,0 +1,20 @@ +#!/bin/sh + +# Download and display X-Image images + +: ${VIEWER:=fbi} + +# Create temporary directory for images +dir=/tmp/$RANDOM +mkdir $dir + +grep '^X-Image: ' | +sed 's/^X-Image: //' | +while read url +do + curl "$url" > $dir/$RANDOM +done + +# Display images and delete them afterwards +$VIEWER $dir/* < /dev/tty +rm -r $dir -- cgit v1.2.3