diff options
author | Aki <please@ignore.pl> | 2020-08-05 23:07:18 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2020-08-05 23:07:18 +0200 |
commit | 09fad3455b734ce8108afc4cc3df9248c539a713 (patch) | |
tree | 30dcd8b73dc28ee09525183055055025438e2171 | |
download | browse-09fad3455b734ce8108afc4cc3df9248c539a713.zip browse-09fad3455b734ce8108afc4cc3df9248c539a713.tar.gz browse-09fad3455b734ce8108afc4cc3df9248c539a713.tar.bz2 |
Initial browse script; same as at the end of the post
-rwxr-xr-x | browse | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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" |