1

When I click on a file in chromium, it calls xdg-open to open the file based on its mime type.

For example, if I click on a file with a .torrent extension, it opens it in my torrent client.

Is it possible to disable the use of xdg-open, and instead specify which extensions should be opened in which applications?

4
  • 1
    Chromium is opensource, so it's possible. Sep 6, 2020 at 15:55
  • @Ipor Sircer - please tell me how? Sep 6, 2020 at 16:56
  • 1
    @400theCat: by modifying the source but it's the hard way Sep 8, 2020 at 21:47
  • Please, look into this relevant post. Seems this will work in your case. @400theCat Sep 10, 2020 at 11:11

1 Answer 1

0

Changing the defaults application that xdg-open use, and instead specifying your own/preferred one is an easy task, and also doesn't pertain to chromium directly:

  • Using perl-file-mimeinfo or mimeinfo
/usr/bin/vendor_perl/mimeopen -d $file.ext

which will then open a prompt where you can place the name of the wanted application, that you want to open it with.

  • Using xdg tooling
xdg-mime default Thunar.desktop inode/directory

You can look into your MIME database on ~/.local/share/applications/defaults.list or ~/.local/share/applications/mimeapps.list to see existing entries (you can edit them, but i don't recommend to) and check what you want to change.

Refer to the Archwiki for more information.

Do remember that application assigned with xdg/or other method can overlap. So be wary by first running xdg-mime query default protocol/filetype first, or by looking into the previously mentioned MIME database directories.

4
  • I am not asking how to change xdg default application. I am asking how to launch application directly from chromium, without using xdg Sep 10, 2020 at 11:58
  • So you basically want to do like what firefox does, and set the default application per filetype directly in chromium, without relying on xdg? Sep 10, 2020 at 18:54
  • I just thought i would give an alternative, since xdg is pretty much anchored in Linux ecosystem, and while it's true that it's not the most documented piece of software, it is easier to use than it look like. Sep 10, 2020 at 18:55
  • exactly. I want to do like what firefox does, and set the default application per filetype directly in chromium, without relying on xdg Sep 11, 2020 at 6:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .