summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-06-09 12:42:32 -0500
committerzachir <zachir@librem.one>2023-06-09 12:42:32 -0500
commit864b1a83fdffb52ca43c6d154198518fa71a3c72 (patch)
tree0b3288c303720a72cda720758493296501908f7d
parent438f86a4960ee59e6ce07a27cce893e69f40ba42 (diff)
use sixel image preview lf
-rwxr-xr-xlf/preview8
1 files changed, 2 insertions, 6 deletions
diff --git a/lf/preview b/lf/preview
index e24c381..6140cf7 100755
--- a/lf/preview
+++ b/lf/preview
@@ -1,12 +1,8 @@
#!/bin/sh
image() {
- if [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
- printf '{"action": "add", "identifier": "PREVIEW", "x": "%s", "y": "%s", "width": "%s", "height": "%s", "scaler": "contain", "path": "%s"}\n' "$4" "$5" "$(($2-1))" "$(($3-1))" "$1" > "$FIFO_UEBERZUG"
- exit 1
- else
- chafa "$1" -s "$4x"
- fi
+ geometry="$(($2-2))x$3"
+ chafa "$1" -f sixel -s "$geometry" --animate false | fold -w 65535
}
batorcat() {