- Published on
Setting Default Browser in Terminal using XDG
- Authors
- Name
- Shailesh Aanand
- @shaileshaanand
Setting Default Browser in Linux Terminal
Using xdg
-
Install
xdg-utils
-
On Debian based systems, you can install
xdg-utils
withsudo apt install xdg-utils
-
On Arch based systems, you can install
xdg-utils
withsudo pacman -S xdg-utils
-
-
Set Default Browser
xdg-settings set default-web-browser firefox.desktop
Replace
firefox.desktop
with the name of your browser's desktop file.-
You can list all available browsers with
ls /usr/share/applications/*.desktop
-
To search for a specific browser, use the
grep
command.ls /usr/share/applications/*.desktop | grep -i firefox
Replace
firefox
with the name of your browser.
-