dotfiles

Alpine Linux dotfiles

git clone git://git.lin.moe/dotfiles.git

 1#!/bin/sh
 2
 3if [ -x "$(command -v bat)" ]; then
 4    FALLBACK_CMD="bat --color always --plain"
 5else
 6    FALLBACK_CMD=cat
 7fi
 8
 9case "$1" in
10    *.tar*) tar tf "$1";;
11    *.pdf) pdftotext "$1" -;;
12    *.bmp|*.jpg|*.jpeg|*.png|*.xpm|*.webp|*.tiff|*.gif|*.jfif|*.ico) chafa "$1" -f sixel -s "$(($2-2))x$(($3-2))" | sed 's/#/\n#/g';;
13    *) $FALLBACK_CMD "$1" ;;
14esac