I have tried to set my default browser for opening URLs to Chromium using:

xdg-settings set default-web-browser chromium.desktop

(yes I checked out whether /usr/share/applications/chromium.desktop existed first before running this command and it does exist) and it returns:

xdg-settings: unknown desktop environment

i3 isn't a desktop environment so I can definitely understand this error, but is there a way around it? The reason I want xdg-open to open URLs using Chromium is that running notebook() from the SageMath command-line attempts to open the notebook in one's default web browser (using xdg-open). Presently this obviously fails (no browser, or application for that matter, is opened to the URL), so I'd like to get this to work which I believe will require me to get xdg-open to open URLs in Chromium.

2 Answers 2


Install perl-file-mimeinfo and configure it that way. See the Arch Wiki article on xdg-utils:

If no desktop environment is detected, MIME type detection falls back to using file which—ironically—does not implement the XDG standard. If you want xdg-open to use XDG MIME Applications without a desktop environment, you will need to install perl-file-mimeinfo or switch to one of the resource openers that support XDG MIME Applications.


I set it in /usr/share/applications/defaults.list and it worked for me (opening links from the Slack app). Indeed, the list of available applications is /usr/share/applications/*.desktop

These lines had to be edited in my case:


This can probably also be done per-user in ~/.config/mimeapps.list

You must log in to answer this question.

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