According to the man page, xdg-open will open a file using the application the user has configured. But how is that application actually determined? I can see no config files associated with xdg-utils, so where are my settings stored and how can I modify them? Seeing how a simple PNG file opens Internet Explorer using Wine, I need to change these settings.
- 55,929
- 26
- 146
- 227
- 4,361
- 2
- 28
- 42
1 Answers
Look at the content of the xdg-open file, and you will notice that it is a simple shell script. Its main task is identifying the desktop environment in use, which will then be used to delegate the task to a specific tool:
- KDE delegates to
kde-openorkfmclient - Gnome delegates to
gvfs-openorgnome-open - Mate delegates to
gvfs-openormate-open - XFCE delegates to
exo-open - LXDE delegates to
pcmanfm, with fallback to “generic” for most URLs - Enlightenment delegates to
enlightenment_open - Everything else is termed “generic”, and the script tries its own luck
So the core message is this: in most situations, one of these delegates will do the actual work, so you should check about how these are configured.
For example, I'm running XFCE, so xdg-open calls exo-open which uses the XFCE settings available through the XFCE settings user interface and stored in ~/.local/share/applications/mimeapps.list.
For details about the config files in use, strace -e file can be useful. And if you are in the “generic” situation and want to see what xdg-open itself does, you can try sh -x `which xdg-open` file.name.
- 4,361
- 2
- 28
- 42
-
2[Similar answer](http://superuser.com/a/918994/139893) for different question. :-) – patryk.beza Jan 19 '17 at 10:21