at main 525 B view raw
1#!/bin/sh 2 3# check here : https://www.youtube.com/watch?v=50BMBT05Wk0 4 5# Run the command below to give this file an execution permission 6# `chmod +x previewer.sh` 7 8case ${1##*.} in 9 7z|zip) 7z l -p -- "$1" && exit 1;; 10 jpeg|jpg|png|gif) chafa --clear --animate=off --symbols space -s "$2x$3" "$1" && exit 1;; 11 # TODO: add fallback to chafa 12 md) glow -w "$2" -p -s dark "$1" || cat $1 && exit 1;; 13 # TODO: use 'cat' first, then replace it with glow 14 *) bat --style=plain --color=always "$1" || cat "$1" && exit 1;; 15esac