about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-25 16:54:56 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-25 16:54:56 +0100
commit7d3952a57ff7e1e7cf0076c5bc0b00dca05545d1 (patch)
treefac7d0e9cb10076b620a3c2530509a586196d06c
parentfix(modules/lf): Ensure, that the remote mapping source command works (diff)
downloadnixos-config-7d3952a57ff7e1e7cf0076c5bc0b00dca05545d1.tar.gz
nixos-config-7d3952a57ff7e1e7cf0076c5bc0b00dca05545d1.zip
fix(modules/lf/ctpv/helpers): Turn of `chafa`'s animations
-rw-r--r--modules/by-name/lf/lf/ctpv/helpers.sh25
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"
 }