diff options
Diffstat (limited to 'modules/by-name/lf')
-rw-r--r-- | modules/by-name/lf/lf/ctpv/helpers.sh | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/modules/by-name/lf/lf/ctpv/helpers.sh b/modules/by-name/lf/lf/ctpv/helpers.sh index 379a98a4..dacda766 100644 --- a/modules/by-name/lf/lf/ctpv/helpers.sh +++ b/modules/by-name/lf/lf/ctpv/helpers.sh @@ -17,36 +17,17 @@ echo_err() { echo "$@" >&2 } -noimages() { - [ -n "$noimages" ] -} - -autochafa() { - [ -n "$autochafa" ] -} - -chafasixel() { - [ -n "$chafasixel" ] -} - chafa_run() { - format='-f symbols' - autochafa && format= - chafasixel && format='-f sixels' - - # The `$format` variable needs to expand to two arguments - # shellcheck disable=SC2086 - chafa --size "${w}x${h}" $format "$1" | sed 's/#/\n#/g' + # TODO: Animation support would be nice, but it would need to be supported in chafa by + # allowing us to make a call to ctpvclear after each image is displayed. <2024-11-25> + chafa --size "${w}x${h}" --animate=off "$1" | sed 's/#/\n#/g' } send_image() { - noimages && return 127 - chafa_run "$1" } convert_and_show_image() { - noimages && return 127 [ -n "$cache_valid" ] || "$@" || exit "$?" send_image "$cache_f" } |