Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with fzf #109

Open
tapyu opened this issue Dec 22, 2022 · 5 comments
Open

Integration with fzf #109

tapyu opened this issue Dec 22, 2022 · 5 comments

Comments

@tapyu
Copy link

tapyu commented Dec 22, 2022

Does anybody know how to integrate the viu with fzf? My goal it to make fzf print the pdf cover image in the preview section. At the moment, my humble code is

function fpp()
{
  # open PDF using fuzzy finder with preview
  rg --type 'pdf' --files | fzf  --preview-window down:80% --preview '
      pdftoppm -f 1 -l 1 -singlefile -jpeg -tiffcompression jpeg -- {1} | viu -
      '
}

It prompts to
image

Any help is welcome :)

@tapyu
Copy link
Author

tapyu commented Dec 22, 2022

When I use viu -b it works though, what is happening?

@IceAsteroid
Copy link

IceAsteroid commented Feb 19, 2023

Yeah, integration with fzf while having the original resolutions of images would be perfect.

It works with -b option to force block output though, but not with the original resolutions.

It may be the problem from fzf's side. Could anyone tell me if it's not caused by viu? So I can make an issue post on fzf's repo.

@sweetbbak
Copy link

its kind of both but major factor is fzf. The thing is, is that this works perfectly fine with Ueberzug (which is now out of development but is still the only working option) kitty +kitten icat used to work until last month on kitty terminal when they rebuilt icat to be faster. Fzf draws another buffer and cant display image directly.

It sucks because there is almost nothing that is like fzf that also has the option for previews, let alone image previews. A lot of the choice menus dont give you the index of the item you are on so you cant really make it work in a hacky way. Its weird because I'm not sure how ueberzug is still the only one that works when it was developed as a stop-gap years ago. It seems like this is a very common need but theres nothing that really fills that gap right now, I've been looking for a long time.

@tapyu
Copy link
Author

tapyu commented Mar 12, 2023

@sweetbbak Why/How did Ueberzug make it work? AFAIK Ueberzug is permanently out due to harassment... I used to use ueberzug too.

@sweetbbak
Copy link

yea, they are done for good with ueberzug, which is really unfortunate. It does still work though and there is a new project called Ueberzugpp in C++ that is reviving it. It intends to be a drop in replacement for ubz but I was having a few issues compared to the original project when it came to use with fzf. Mainly the image would freeze and not change but I also need more time to figure it out.

I just started using the original one since icat broke with fzf. There are a couple of other projects that are using the Kitty protocol (with kitty and St) and Unicode character placeholders which may fix the issue as well. Right now just using the original ueberzug is the only way I've been able to get it to work. Fzf can only read the escape codes as strings and cant interpret them to images, ubz display over the top of fzf all together

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants