thimc / lfimg

Image preview support for lf (list files) using Überzug
GNU General Public License v3.0
252 stars 45 forks source link

Ueberzug does not start, the image is shown with chafa only #35

Closed Franktdf closed 2 years ago

Franktdf commented 2 years ago

This is really a nice script, it just does not work for me. When I run lfrun and visit images, the image is only shown with chafa, not ueberzug.

My setup is basically LARBS from Luke Smith, but some minor changes, like using emacs command type in the terminal Windows manager is dwm The Terminal is st. (lfrun does not work with urxvt either on my setup) I installed ueberzug with pip, it is in /usr/bin. ranger works without problem with ueberzug (for image previews :-) )

Please let me know what additional information you may need.

thimc commented 2 years ago

Hi,

Please check if any of these variables are set in the current terminal session, the reason is that if you're SSH:ing in to a machine then ueberzug will not work and therefore chafa is used.

SSH_CLIENT
SH_TTY
Franktdf commented 2 years ago

You are really quick to reply. I use zsh, this is what I found: export | grep SSH: LESSHISTFILE=- SSH_AGENT_PID=5017 SSH_AUTH_SOCK=/tmp/ssh-XXXXXXypsXPJ/agent.5016

export | grep SH: LESSHISTFILE=- MOTD_SHOWN=pam SHELL=/bin/zsh SHLVL=3 SSH_AGENT_PID=5017 SSH_AUTH_SOCK=/tmp/ssh-XXXXXXypsXPJ/agent.5016

Does not seem to be wrong, or?

xinit: dwm is started this way: ssh-agent dwm

Maybe that is wrong?

Franktdf commented 2 years ago

I replaced ssh-agent dwm with exec dwm in xinit. No reference to any SSH anymore when I run export in the terminal.

The problems is still the same, that images are only viewed with chafa.

Any other proposal?

thimc commented 2 years ago

I'm not sure what the issue is to be honest.

Have you verified your lfrc file and are the cleaner and preview scripts executable?

Franktdf commented 2 years ago

Yes, the scripts are executable. Preview does execute chafa, I guess. I also added the required two lines to lfrc and start lf with lfrun (actually use an alias to lfrun).

I do not really understand your scripts. I do not even understand how ueberzug is actually executed. How would I need to change preview so that it just executes ueberzug without bothering SSH and chafa? (I tried and failed already here :-) ).

Anyway, thank for you kind feedback, In the end is not the end of the world (not THIS) if lf does not do all I want it to do., I can still use ranger. But having lf with image preview would really be perfect.

thimc commented 2 years ago

I see. If you want to force the use of the ueberzug then simply edit the lfrun script (from which you use to launch lf with ueberzug) and remove the if statement and only keep the code in the else block.

Now that I think of it, are you even using lfrun to run lf with ueberzug?

Franktdf commented 2 years ago

There is an alias lf='lfrun', but for testing I do call lfrun directly.

After editing lfrun ans proposed, the image preview is only loading . . ., bit no image preview at all in st. Very strangely, in urxvtchafa is again used for image preview. I also removed the if-else from the preview script, still urxvt calls chafa. stbehaves "normal", I guess.

scope in '.config/lf' calls chafa for images: image/*) chafa --fill=block --symbols=block -c 256 -s 80x"${HEIGHT}" "${FILE_PATH}" || exit 1;;

Franktdf commented 2 years ago

Solved it.

The `~/.config/lf/lfrc' from larbs.xyz by Luke Smith has its own preview mechanism, which collides with your scripts. I removed that, and now image preview works perfectly with your orignal lfrun and preview script.

Thank you for your pations and help!