You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3815
-- Commit Summary --
* [filebrowser] Change external open default to xdg-open
-- File Changes --
M plugins/filebrowser.c (2)
-- Patch Links --
https://github.com/geany/geany/pull/3815.patch https://github.com/geany/geany/pull/3815.diff
The existing command "nautilus" is a Gnome file manager, so its not likely to be available on non-gnome distros, so "xdg-open" is likely to be more portable, but is it doing the same thing?
The (expletive deleted useless) nautilus [man page](https://linux.die.net/man/1/nautilus) doesn't say what it does when run with a file path, does it open that file or open the file manager at the path with the file selected[^1]? In other words does xdg-open do the same thing?
Does it matter since "nautilus" won't work for lots of people anyway but xdg-open probably will?
[^1]: no I can't try nautilus, it isn't installed on my non-Gnome desktop and the file manager here when run with a file opens itself with the file selected, it does not open the file.
The default contains the `%d` wildcard, which is replaced by the directory. [This man page](https://www.mankier.com/1/xdg-open) says "Open the current directory in the default file explorer: `xdg-open .`", which implies you can give it a directory and it will open a file explorer program. It works on my Linux Mint anyway. (I did the cinnamon install and I don't have nautilus).
does it open that file or open the file manager at the path with the file selected[1](https://github.com/geany/geany/pull/3815#user-content-fn-1-d4169df4d23068cfe... In other words does xdg-open do the same thing?
xdg-open with a file (i.e. if the user changes `%d` to `%f`), opens the associated program for that file, it doesn't open the file manager. If the user wanted the file manager to select the file, they should change it to e.g. `nemo %f`, which works on my system.
OK to merge?
(I did the cinnamon install and I don't have nautilus).
Welcome to the light ;-)
As the default `xdg-open %d` opens a file manager then thats safe, it won't open some random software on the users system. If they change the setting they are responsible for the consequences.
So my opinion is that `xdg-open` looks to be a better more portable (among Linuxes) alternative to `nautilus` and its ok to merge, although give the weekend at least for others (with non LM distros) to look at it.
I think this is OK even if when called for a file the file will be opened and not the file manager. Since the whole command can be configured and by the same default `%d` is used, the behavior should not be changed, just the default will work probably for more users.
Merged #3815 into master.
github-comments@lists.geany.org