This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env sh | |
case $(file -bL --mime-type "$1") in | |
cannot\ open*) exit ;; | |
inode/directory) ls --color=always "$1" ;; | |
text/html) w3m -O UTF-8 -dump "$1" ;; | |
text/troff) man ./"$1" ;; | |
application/gzip | application/x-tar | application/zip | application/x-7z-compressed | application/vnd.rar | application/x-bzip*) bsdtar --list --file "$1" ;; | |
application/json) jq --color-output . "$1" ;; | |
audio/* | image/* | application/octet-stream) mediainfo "$1" || exit 1 ;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assumed commands: | |
# git (plugin management) | |
# wget (downloading preview script) | |
# bat (tab preview) | |
# delta (tab preview) | |
# w3m (tab preview) | |
# bsdtar (tab preview) | |
# jq (tab preview) | |
# mediainfo (tab preview) | |
# odt2txt (tab preview) |
OlderNewer