vifm: Fix wezterm image preview with chafa

We now use chafa to preview images. We use its iterm mode
since that seems to be the best integrated into wezterm
currently.

We have to use uncached previews so it is a little slower,
but at least it functions perfectly after the first image
is displayed.
This commit is contained in:
Marty Oehme 2023-10-03 13:00:29 +02:00
parent 7ccd7e4757
commit ba042db7df
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -427,12 +427,12 @@ fileviewer *.[1-8] man ./%c | col -b
" Images " Images
filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
\ {View in imv}
\ imv %f %i,
\ {View in viu} \ {View in viu}
\ viu --once --name %f; read -k 1 -s -r, \ viu --once --name %f; read -k 1 -s -r,
\ {View in nsxiv directory viewer} \ {View in nsxiv directory viewer}
\ vifm-thumbnailer %c, \ vifm-thumbnailer %c,
\ {View in imv}
\ imv %f,
\ {View in nsxiv} \ {View in nsxiv}
\ nsxiv %f, \ nsxiv %f,
\ {View in vimiv} \ {View in vimiv}
@ -444,11 +444,9 @@ filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
\ {View in gpicview} \ {View in gpicview}
\ gpicview %c, \ gpicview %c,
fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
" to circumvent the bug: https://github.com/atanunq/viuer/issues/44 " needs to be %pu uncached or it flickers itself into oblivion :(
" thus, change the viuer library and build it with the new lib locally \ exist chafa && chafa -f iterm --size %pwx%ph %c:p %pd %pu %N || echo chafa not found
" put it into the local bin directory and you can see full pics. set previewoptions+=graphicsdelay:0
" Otherwise falls back to block-sized display
\ exist ~/.local/bin/viu && env -u COLORTERM ~/.local/bin/viu -w %pw -s %c %pd || env -u COLORTERM viu -b -w %pw -s %c %pd
" OpenRaster " OpenRaster
filextype *.ora filextype *.ora