NikitaIvanovV / ctpv

Image previews for lf file manager
https://www.nikitaivanov.com/man1/ctpv
MIT License
264 stars 23 forks source link

ueberzugpp support on wayland #77

Open bartlibert opened 11 months ago

bartlibert commented 11 months ago

ueberzugpp supports wayland, but I cannot use it in ctpv because there is an explicit check that disables ueberzug in wayland.

I recompiled with the change below and now image previews are working perfectly.

Probably some better fix could be added (check for ueberzugpp? introduce a forceueberzug flag? ...) but this at least seams to work fine.

diff --git a/sh/helpers.sh b/sh/helpers.sh
index fef8691..f194557 100644
--- a/sh/helpers.sh
+++ b/sh/helpers.sh
@@ -52,7 +52,7 @@ set_image_method() {
    [ -n "$forcekittyanim" ] && is_kitty && is_anim_image && { image_method="$image_method_kitty"; return 0; }
    [ -n "$forcechafa" ] && exists chafa && { image_method="$image_method_chafa"; return 0; }

-   [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && exists ueberzug &&
+   exists ueberzug &&
        [ -n "$fifo" ] && [ -e "$fifo" ] &&
        { image_method="$image_method_ueberzug"; return 0; }
cain-dev commented 10 months ago

that would be nice