tut
tut copied to clipboard
Documentation request(?): How do users on Macs handle media?
By default, (M)edia, (A)vatar, (Y)ank appear to do nothing on Macs; is there some workaround here?
Maybe I should make this more OS aware, but it should work if you edit your config.ini and set image-viewer=xdg-open to image-viewer=open instead.
I have changed my config.ini file to use open, but it still is not working. Same for the other media types, too.
[media]
# Your image viewer.
# default=xdg-open
image-viewer=open
# Open the image viewer in the same terminal as toot. Only for terminal based
# viewers.
# default=false
image-terminal=false
# If images should open one by one e.g. "imv image.png" multiple times. If set
# to false all images will open at the same time like this "imv image1.png
# image2.png image3.png". Not all image viewers support this, so try it first.
# default=true
image-single=true
# If you want to open the images in reverse order. In some image viewers this
# will display the images in the "right" order.
# default=false
image-reverse=false
On Monterey 12.6.1 with a 2021 MBP
@milofultz Just in case - were you attempting to open an image or copy something/open other media (video/audio)?
You'd need to replace the entries for video-viewer and audio-viewer as well. As for the copy/yank, I'm not sure how that would be done on MacOS
Edit: Also, when you exited tut, were there any error messages leftover in the terminal?
Yeah, I changed the entry for each of those to open with no success. No errors in the terminal on exit either. I'll see if I can make one by changing stuff tho and report back
Does open work outside of tut? "open test.png'
Unfortunately I don't own a Mac, so I can't test
Yep, open works in the terminal normally. Is there a log or verbose mode I can run to see what messages are happening under the hood as I go?
Does viewing media on mac work for you @elijahmanor?
Yep, open works in the terminal normally. Is there a log or verbose mode I can run to see what messages are happening under the hood as I go?
I'll try and make a small program that you can test and search the web a bit to see if I can find a solution
I made it work by adding a suffix to the filename, e.g. ".png" and not deleting the temp file. Tested on MacOS and WSL.
Hey @iucario, could you elaborate a bit? I'd love to test this on my system to confirm.
Hey @iucario, could you elaborate a bit? I'd love to test this on my system to confirm.
Sure. You can check my modification to the media.go: https://github.com/RasmusLindroth/tut/compare/master...iucario:tut:media
Be aware that the temp files are kept on the disk. I am creating a temp directory named tut and saving the files in there, so that I can clear the directory easily. Hope that helps.
Confirming @iucario's fix works on my machine. I built from their media branch and ran it. On using Media and Avatar, the files are opening using a custom config that uses open instead of the default for all the -viewer options.
I have now released a new version of tut (1.0.31) that adds extensions to the files. Does it fix the issue?
Hmm, it does trigger the correct open invocation, but it says it can't find the file once it has been opened.
This is what I get when I open using Media 
Sometimes when I open something, it's just an empty image.
I'm going to try and diff @iucario's branch and this one and see if I can sleuth it out
This is my config:
image-viewer="open -W -a Preview "
link-viewer="open -u "
video-viewer="open -W -a VLC "
Aa, you must set the -W flag, because open doesn't wait for the application to exit. That will help me in my plan to make tut OS aware
That works! ~~It's kind of funny if you open multiple media files you have to quit Preview for the next one to open, but minor problems. :)~~ I forgot about the image-single config flag! Thanks again!