RasmusLindroth / tut

TUI for Mastodon with vim inspired keys
https://tut.anv.nu
MIT License
446 stars 29 forks source link

Media not opening #237

Closed jsanz closed 1 year ago

jsanz commented 1 year ago

1.0.26 introduced an issue for me that remains until the last release. For some reason I can't open media files from xdg-open in Linux

image-viewer=xdg-open

On the following clip I check that the file in /tmp/ is not present with the first configuration.

Peek 2022-12-28 10-33

On the other hand, I can open images with this other setting with alacritty and chafa, where the file is correctly placed in /tmp

image-viewer=alacritty -e chafa --watch

Any ideas what could be wrong?

RasmusLindroth commented 1 year ago

It must me that the file gets removed before the image viewer has finished, but tut should wait with the deletion of files till the image-viewer program has finished. What program does xdg-open run when you open images? Is it part of maybe Gnome?

jsanz commented 1 year ago

xdg-open was using eog from Gnome, I changed to an alternative viewer (ristretto, from XFCE) and it works as expected.

I also changed xdg-open for the video player by vlc and it also works as expected so yeah, this seems to be some weird behavior from Gnome.

Closing, thanks for the suggestion!!

Dronakurl commented 1 year ago

Hi, I experience the same problem with 1.0.34. xdg-open defaulted to google-chrome. It doesn't work with ristretto either. The file seems to be deleted. Any hints for me?

jsanz commented 1 year ago

Sharing my settings in case they are of any help

[media]
image-viewer=ristretto
image-terminal=false
image-single=true
image-reverse=false

video-viewer=vlc
video-terminal=false
video-single=true
video-reverse=false
RasmusLindroth commented 1 year ago

Hi, I experience the same problem with 1.0.34. xdg-open defaulted to google-chrome. It doesn't work with ristretto either. The file seems to be deleted. Any hints for me?

If you try the version 2.0.0 and set delete-temp-files=false under [media]. Can you open the image?

Dronakurl commented 1 year ago

Congratulations to Version 2.0.0! Unfortunately: Yes it works, but only with this setting. When I set the image viewer myself in the config.toml, it works also with the delete-temp-files=true option