Registering web browser with update-alternatives

Dotan Cohen dotancohen at gmail.com
Mon Dec 20 12:07:49 UTC 2010


On Mon, Dec 20, 2010 at 13:33, Nils Kassube <kassube at gmx.net> wrote:
> Dotan Cohen wrote:
>> Hi all, I need to set the default web browser on a Kubuntu 10.10
>> install as a script in /home/user. How can I add that script, so that
>> update-alternatives might let me use it? Thanks!
>
> I'm not sure what you want to achieve. Do you want to use a script
> instead of the default system browser?

No, I need the user's default web browser to be a script in his home
directory. Other users on this machine (there is one other) should not
be affected.

> If it is a system wide setting,
> it should be in a system directory, not in /home/user which is probably
> the home directory of one of the users on that machine. You'd better use
> /usr/local/bin instead. Otherwise the user might change the script after
> it is installed as the default browser. And that is probably not what
> the system administrator wants.
>
> Anyway, according to the man page for update-alternatives, I would
> assume that you could add your script with a command like this:
>
> sudo update-alternatives --set x-www-browser /usr/local/bin/myscript
>

No, that wouldn't add it, but after fighting with the
/var/lib/dpkg/alternatives/x-www-browser config file I was able to add
the script to there. Note to archive diggers: blank lines in that file
matter! To add a new entry, don't touch existing lines but rather put
the path on a new line at the end of the file, then the priority, then
two blank lines.

However, even after adding the script I discovered that
update-alternatives does only affect the whole system, not individual
users. I thought that I could affect an individual's preferences by
invoking update-alternatives without sudo, alas I was mistaken.

Therefore, how does one change the default web browser? I have
configured the default web browser with KDE's System Settings, but
Thunderbird does not conform. Maybe because it is a GTK app?

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com




More information about the ubuntu-users mailing list