Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I separately installed the Firefox Beta and Alpha channels, and have desktop configuration files pointing to them in ~/.local/share/applications. However, stable Firefox is being used as my default browser by the system. (Firefox Beta used to be used until I messed with the "Default Applications" in System Settings, where it is not listed.)

I tried running sudo update-alternatives --config x-www-browser to manually change it, but it's only recognizing Chromium and Firefox (stable) and showing them as a choice.

What can I do to get custom desktop configuration files in ~/.local/share/applications to be seen as default alternatives? I think I may have to fiddle with the desktop config files, or with mimeinfo.cache or mimeapps.list?

Running Oneiric.

Here is the content of the firefox-beta.desktop file I created:

[Desktop Entry]
Name=Firefox Beta
Exec=firefox-beta -P Beta -no-remote
Icon=firefox
Terminal=false
X-MultipleArgs=false
Type=Application
StartupNotify=true
StartupWMClass=Firefox
Categories=GNOME;GTK;Network;WebBrowser;
Comment[en_US]=Firefox Beta Channel
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;
Name[en_US]=Firefox Beta

[NewWindow Shortcut Group]
Name=Open a New Window
Exec=firefox-beta -new-window about:blank
TargetEnvironment=Unity
share|improve this question

2 Answers 2

up vote 9 down vote accepted

You're looking for the this command:

sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /path/to/firefox-beta 100

That adds /path/to/firefox-beta to the x-www-browser alternatives with a priority of 100 (auto-switching to it unless there's something else with a higher priority). You can then use update-alternatives --config as usual. To remove it, run the following:

sudo update-alternatives --remove x-www-browser /path/to/firefox-beta

This removes that particular entry from the alternatives for x-www-browser.

share|improve this answer

You can use --set instead of --config, in other words:

sudo update-alternatives --set x-www-browser /path_to_executable
share|improve this answer
    
--set only gets you options listed by the --config option. So saith the documentation. For instance: $ sudo update-alternatives --set x-www-browser /bin/true update-alternatives: error: alternative /bin/true for x-www-browser not registered, not setting. –  zanfur Nov 21 '11 at 10:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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