From 09fad3455b734ce8108afc4cc3df9248c539a713 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 5 Aug 2020 23:07:18 +0200 Subject: Initial browse script; same as at the end of the post --- browse | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 browse diff --git a/browse b/browse new file mode 100755 index 0000000..ecce912 --- /dev/null +++ b/browse @@ -0,0 +1,9 @@ +#!/bin/sh +TMP=$(mktemp -p /dev/shm) && + { TYPE=$(curl -sL -w "%{content_type}\n" $@ -o "$TMP") && case "$TYPE" in + application/pdf) zathura "$TMP";; + image/*) sxiv "$TMP";; + text/*) less "$TMP";; + *) hexdump "$TMP";; + esac } +rm -f "$TMP" -- cgit v1.1