I am trying to write a shell script that automates the setup of my Elementary distro so I can quickly reinstall everything on a new machine. As such I am looking to see how I can set the default browser from within a shell script, preferable without user input. Thanks! Luke


1 Answer 1


I found this could be done with xdg-settings set default-web-browser brave-browser.desktop

where brave-browser.desktop is the desktop file of the desired browser

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.