xdg-open not open default browser

回眸只為那壹抹淺笑 提交于 2019-12-04 10:04:36

To set a default browser, make sure that a .desktop file exists for your preferred browser. I'll be setting Mozilla Iceweasel for this example:

$ ls /usr/share/applications/iceweasel.desktop
iceweasel.desktop

Assured you have the file, run:

$ xdg-settings set default-web-browser iceweasel.desktop
# Test that it works
$ xdg-open "http://example.com"

If you don't have a .desktop file:

I use the program surf, which doesn't have a .desktop file. To set this as your web browser, first create the file ~/.local/share/applications/surf.desktop with this following content:

[Desktop Entry]
Type=Application
Name=surf
Comment=Surf minimal web browser
Terminal=false
Exec=surf
Categories=Network;WebBrowser

While not all of this content is required, it helps categorize the file for any future use.

Set the default browser like normal:

$ xdg-settings set default-web-browser surf.desktop

And now you're good to go!

Solved, just open chrome browser and set as default browser. This fix the problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!