tulir / gomuks

A terminal based Matrix client written in Go.
https://maunium.net/go/gomuks
GNU Affero General Public License v3.0
1.3k stars 124 forks source link

[Feature Request] Create a plumber setting instead of hard-coding xdg-open #433

Open AlexBocken opened 11 months ago

AlexBocken commented 11 months ago

Personally I've always been a large fan of using rifle instead of xdg-open when possible. Could maybe a setting be implemented where one could set the plumber instead of xdg-open being hard-coded?

Maybe I can take a look and patch together a PR in the coming day if it is wanted.

goodboy commented 11 months ago

Woo i love this and it pertains to what i'm still planning to finish in #422 😎

Another launcher that might be worth thinking about (if we wanted to generalize) is https://github.com/chmln/handlr which I've been meaning to give a serious try 🏄🏼

AlexBocken commented 11 months ago

Is that what your last point in the original comment of #422 pertains to? (Btw, really looking forward to that one being merged)

it'd be suuuper slick if we could use ranger for opening media files as well - eg. when clicking an inline image?

I wasn't sure whether that's the same idea. I must admit I'm not too familiar with the code base and/or Go, so if you think it's quick for you to implement and are open to do it please go ahead. The basic idea is just to replace "xdg-open" in

https://github.com/tulir/gomuks/blob/09a927955810f6f0c6d3f4809d9b01eda365fd39/lib/open/open_xdg.go#L5C1-L5C27

WIth a user-settable string.

goodboy commented 11 months ago

(Btw, really looking forward to that one being merged)

Yeah, sorry just been totally derailed by a new distro and how to get stuff working and setup for dev in golang again. I'm definitely looking forward to it too 😂

I wasn't sure whether that's the same idea. I must admit I'm not too familiar with the code base and/or Go, so if you think it's quick for you to implement and are open to do it please go ahead.

I just think it's somewhat related in the sense that choosing a program for file-dialogs is more or less related to xdg-open portals (at least afaiu) and thus i think what you're more or less asking for is pluggable xdg-portal backends?


I have the following resources on my learning list for all this:

goodboy commented 11 months ago

@AlexBocken oh also not sure if you're in the matrix room but we can discuss in their as well if you want 😉

TamasBarta commented 5 months ago

Hello! This feature would be especially amazing for macOS users, since we have open here, and open cannot recognize file headers, only file extensions, so by default it tries to open everything in some default text editor, that I didn't even know existed. (That could be a separate issue to append a proper file extension to the temporary files' names.) Also I believe open will never support to open a file in the same terminal, and wait for its completion, which also would be amazing for opening files in terminal tools.

(I miss Linux so much 😢)