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

[BUG]: swayimg thumbnail backend not working in alacritty+sway #681

Open
kevenwyld opened this issue Jun 21, 2023 · 10 comments
Open

[BUG]: swayimg thumbnail backend not working in alacritty+sway #681

kevenwyld opened this issue Jun 21, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@kevenwyld
Copy link
Contributor

Describe the bug

Thumbnails are not working in sway using alacritty and swayimg.

To Reproduce

run ytfzf -t -T swayimg something

Expected behavior

Thumbnails are shown

Screenshots

20230620_22h19m12s_grim

Information

  • OS: Archlinux
  • Terminal: Alacritty
  • Ytfzf version: git-2012.af476ca
  • Output of readlink $(which sh): bash
  • (if is a thumbnail issue) run ytfzf --thumbnail-log=log.txt and post the file: For some reason this flag does not generate a log. I tried specifying different names and nothing seemed to matter.

Additional context

I was previously using hyprland before running sway. I saw in the code there is a note:

swayimg-hyprland thumbnail viewer may mess up any rules you have for swayimg

I'm not sure what this means though, or whether it is permanent messing up or temporary. Thumbnails in hyprland using the swayimg-hyprland backend did work though.

@kevenwyld kevenwyld added the bug Something isn't working label Jun 21, 2023
@Euro20179
Copy link
Collaborator

not gonna lie, swayimg might simply be broken because I dont maintain it.

Try installing ueberzugpp from the aur, and using ytfzf -T sway

I'll look into fixing the thumbnail log problem.

@kevenwyld
Copy link
Contributor Author

kevenwyld commented Jun 22, 2023

not gonna lie, swayimg might simply be broken because I dont maintain it.

That's totally fair, it's a lot to maintain support for multiple window managers that you probably don't personally use. I've been trying to figure it out on my own too but haven't made much progress yet.

Try installing ueberzugpp from the aur, and using ytfzf -T sway

I tried ueberzugpp from the aur and it still doesn't render thumbnails. I used ytfzf -t -T sway. I also finally got a thumbnail log file to be generated by setting the option in the config file however the file is empty in this particular case.

It kinda feels like the whole thumbnail function isn't running. I put some debugging echo statements in load_thumbnail_viewer and preview_display_image . preview_display_image never runs with either backend.

EDIT: That last part is wrong, disregard that.

@kevenwyld
Copy link
Contributor Author

I just tried the development branch which has some changes the arch git package hasn't gotten yet. No change though.

@Euro20179
Copy link
Collaborator

Keep ueberzugpp installed and try ytfzf -t -T wayland, if that doesn't work i'll try doing some debugging myself.

@tylerdq
Copy link

tylerdq commented Dec 2, 2023

Keep ueberzugpp installed and try ytfzf -t -T wayland, if that doesn't work i'll try doing some debugging myself.

I can confirm that this works. Notably, I was having OP's same issue but on Void Linux. When I ran into dependency hell trying to build ueberzugpp from source on Void I decided to install Bedrock Linux so I can have an Arch stratum alongside my Void stratum and use pacman to install ueberzugpp via the AUR.

It would be great to have an alternative for others who may want high-res thumbnail support with Void/Sway/Alacritty/Swayimg but aren't willing to take the path I chose.

@Euro20179
Copy link
Collaborator

It would be great to have an alternative for others who may want high-res thumbnail support

Previously I had supported kitty without ueberzugpp but it broke, and wasn't sure how to fix it.

fzf does not support sixel, nor the kitty protocol, so in order to do either some hacks have to be done described below.

Here's how I think it would have to be done:

  1. create a process that listens for when a new image should be displayed (either sixel or kitty), and display it
    1. This process should be started in preview_start
  2. in preview_display_image notify the process to draw an image.

The reason I think it needs to be done this way is so that the process connects to the terminal, instead of fzf's emulated terminal.

Even so I'm not certain this would work.

I don't particularly feel like implementing this, if someone else wants to give it a shot they can.

Maybe if I'm really bored one day I'll try it, because not relying on ueberzugpp would be nice.

@umop3plsdn
Copy link

it's strange i'm on hyprland and have ueberzugpp installed from the AUR as well and no matter what I do I cannot get thumbnails even though I use other programs with ueberzugpp support such as lobster and those thumbnails work. I did try -Twayland as suggested up the thread and that does work but if i move the ytfzf terminal window the thumbnail viewer does not stay with it and just remains in the same spot. I've even tried using swayimg-hyprland and swayimg with swayimg installed. nogo.

@Euro20179
Copy link
Collaborator

I've even tried using swayimg-hyprland and swayimg with swayimg installed. nogo.

What's wrong with swayimg?

but if i move the ytfzf terminal window the thumbnail viewer does not stay with it and just remains in the same spot

The thumbnail should move when you select a new item.

It's not really possible to move it by itself.

@tylerdq
Copy link

tylerdq commented Dec 5, 2023

The thumbnail should move when you select a new item.

I can confirm this works for me when using -T wayland. The thumbnail does not follow the window when it moves but does update its location correctly when I select a new item. Personally, my use case does not really involve moving the window though.

@umop3plsdn
Copy link

The thumbnail should move when you select a new item.

I can confirm this works for me when using -T wayland. The thumbnail does not follow the window when it moves but does update its location correctly when I select a new item. Personally, my use case does not really involve moving the window though.

oh nice you're right it does update if you change the thumbnail. Ya my use case doesn't really involve moving the window either.. I just happened to do it and noticed it stayed right there. I guess as long as -T wayland works for me I don't really care if the others don't work either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants