mirror of
https://github.com/elkowar/dots-of-war.git
synced 2024-11-06 11:22:23 +00:00
27 lines
444 B
Bash
Executable file
27 lines
444 B
Bash
Executable file
#!/bin/sh
|
|
|
|
|
|
case "$(file --mime-type "$1")" in
|
|
*text*)
|
|
bat --color always --plain --theme base16 "$1"
|
|
;;
|
|
*image* | *pdf)
|
|
if command -v timg; then
|
|
timg -g50x50 -E -F "$1"
|
|
elif command -v catimg; then
|
|
catimg -w 100 -r 2 "$1"
|
|
else
|
|
echo "Install timg or catimg to view images!"
|
|
fi
|
|
;;
|
|
*directory*)
|
|
exa --icons -1 --color=always "$1"
|
|
;;
|
|
*)
|
|
echo "unknown file format"
|
|
;;
|
|
esac
|
|
|
|
|
|
|
|
|