isamert / jaro

a highly customizable xdg-open alternative
GNU General Public License v3.0
67 stars 3 forks source link

redirect xdg-open calls to jaro parameter issue #6

Open dajsn opened 2 years ago

dajsn commented 2 years ago

with redirecting xdg-open call to jaro and the current jaro.desktop thunderbird does not work. It seems to need an %U instead of %F. Testing with a non-URL, e.g. xdg-open ~/test.pdf and %U this still works.

Maybe the jaro.desktop should ship with %U instead of %F?

PS: great project!

isamert commented 2 years ago

Thanks for reporting the issue! I can replace %Fs with %Us in the jaro.desktop file.

Long answer:

I've been using jaro since I created it and I found that the jaro.desktop approach for redirecting xdg-open to jaro has many flaws. .desktop files are quite limited and it causes problems like the one you described above. I recommend simply linking xdg-open to jaro so that jaro can work without any middleman. Of course, this approach may break some stuff in your system, so you have to be careful while doing it. Here are some recommedations:

(assoc
  :pattern ".*"
  :program "/usr/bin/xdg-open %f")

The second step may not be needed (and I'm kinda against it), I just pointed it out so that if you have any workflow that depends on xdg-open, they'll (probably) continue to work this way.

I've been working on a rewrite to stabilize things even more and to add more features. Also this was my first Scheme project, so I'm also trying to improve the maintainability with this rewrite. Another thing is trying to make jaro a drop-in replacement for xdg-open. But I'm a bit tight on schedule due to personal reasons and due to my day job. Hopefully I will focus on this rewrite in the close future, until then you can try this approach if you are feeling brave and report me any problems you encounter :)

Thanks for your kind words!

dajsn commented 2 years ago

Thanks for the long explanation!

I've only took the route of xdg-open -> jaro because i was hesitant to remove xdg-open (since package manager would be really unhappy about it). The obvious solution with symlinking jaro as xdg-open and put it in PATH before the real xdg-open escaped me for some reason. Going with the approach now, so please scrap the %F -> %U idea.

Glad to hear that you are working on an improved version when you have some spare time, looking forward to it.

Please feel free to mark the issue as resolved. Maybe update the "Installation" section from the readme with you above answer to help others :)

erikLundstedt commented 1 year ago

Thanks for the long explanation!

I've only took the route of xdg-open -> jaro because i was hesitant to remove xdg-open (since package manager would be really unhappy about it). The obvious solution with symlinking jaro as xdg-open and put it in PATH before the real xdg-open escaped me for some reason. Going with the approach now, so please scrap the %F -> %U idea.

Glad to hear that you are working on an improved version when you have some spare time, looking forward to it.

Please feel free to mark the issue as resolved. Maybe update the "Installation" section from the readme with you above answer to help others :)

I know im extremely late but: i currently have a script written in fennel that I named xdg-open:

#!/usr/bin/env fennel
(os.execute (.. "jaro " (table.concat arg " ")))

this "should" be equivalent to this:

#!/usr/bin/env sh
jaro $@

exept I got to write it in lisp

Thank you for the great project, hope to see the release of "jaro2.0" soon