*copy working image previews lf config to repo

*set zsh to show colorscript -r at startup
master
alex 2022-09-18 21:52:05 -05:00
parent ef5914ad58
commit 369e5dd7e8
2 changed files with 8 additions and 4 deletions

View File

@ -1,5 +1,9 @@
#!/bin/sh
img () {
chafa "$1" --size="$2"x"$3" | sed 's/#/\n#/g'
}
W="$(($(tput cols)/2 - 10))"
#H="$(tput lines)"
@ -14,9 +18,9 @@ case "$fn" in
*.zip) unzip -l "$1";;
*.rar) unrar l "$1";;
*.7z) 7z l "$1";;
*.jpg | *.JPG | *.jpeg) chafa "$fn" --size="$w"x"$h" ;;#viu -t "$1" -w "$2" ;;
*.png | *.svg | *.gif) chafa "$fn" --size="$w"x"$h" ;;
*.mp4 | *.mkv | *.webm | *.avi | *.mpg | *.mpeg | *.ogv | *.flv | *.wmv | *.WMV) ffmpegthumbnailer -i "$fn" -c jpeg -o - | chafa - --size="$w"x"$h";;
*.jpg | *.JPG | *.jpeg) img "$fn" "$w" "$h";;
*.png | *.svg | *.gif) img "$fn" "$w" "$h";; #viu -t "$1" -w "$W" ;; #chafa "$fn" --size="$w"x"$h" ;;
*.mp4 | *.mkv | *.webm | *.avi | *.mpg | *.mpeg | *.ogv | *.flv | *.wmv | *.WMV) ffmpegthumbnailer -i "$fn" -c jpeg -o - | img - "$w" "$h";;
*.pdf) pdftotext "$1" -;;
*) bat -f "$1";; #*) highlight -O ansi "$1" || cat "$1";;
esac

View File

@ -82,7 +82,7 @@ if ! [ -f $HOME/.local/share/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting
fi
# prompt stuff
pfetch
colorscript -r
#if [ -f "/usr/bin/starship" ]; then
# eval "$(starship init zsh)"