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.
Desktop Environment – How xdg-open Works
desktop-environmentfreedesktopxdg-open
Best Answer
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-open
orkfmclient
gvfs-open
orgnome-open
gvfs-open
ormate-open
exo-open
pcmanfm
, with fallback to “generic” for most URLsenlightenment_open
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
callsexo-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 whatxdg-open
itself does, you can trysh -x `which xdg-open` file.name
.