auroraffd4a5b
lf: use ffmpegthumbnailer for video thumbnail preview
+5 −0
1 file changed
- M .config/lf/scope +5 −0
| @@ -3,6 +3,11 @@ case "$(file -Lb --mime-type -- "$1")" in | |||
| 3 | 3 | image/*) | |
| 4 | 4 | chafa -f sixel -s "$2x$3" --animate off --polite on -t 1 --bg black "$1" | |
| 5 | 5 | ;; | |
| 6 | + | video/*) | |
| 7 | + | CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)" | |
| 8 | + | ffmpegthumbnailer -i "$1" -o "$CACHE" -s 0 | |
| 9 | + | chafa -f sixel -s "$2x$3" --animate off --polite on -t 1 --bg black "$CACHE" | |
| 10 | + | ;; | |
| 6 | 11 | text/*) | |
| 7 | 12 | bat "$1" | |
| 8 | 13 | ;; | |