peasth...@shaw.ca wrote:
> man update-alternatives has no mention of how the priorities of 
> alternatives originate.  The most reasonable explanation I can 
> imagine is that any new alternative is assigned a lower priority 
> than extant alternatives.  Correct?

The package postinst script will include the alternative and the
priority.  For example the 'nano' package with the nano editor
contains:

    update-alternatives --install /usr/bin/editor editor /bin/nano 40 \
      --slave /usr/share/man/man1/editor.1.gz editor.1.gz \
      /usr/share/man/man1/nano.1.gz

That priority is 40 and is assigned by the package.

> My example from last July.
> peter@dalton:~$ update-alternatives --display x-window-manager
> x-window-manager - auto mode
>   link currently points to /usr/bin/openbox
> /usr/bin/openbox - priority 90
>   slave x-window-manager.1.gz: /usr/share/man/man1/openbox.1.gz
> /usr/bin/xmonad - priority 20
> Current 'best' version is '/usr/bin/openbox'.
> 
> Suppose that I prefer xmonad to openbox.  
>
> One way to indulge my prefence would be to somehow impose 
> it in the operation of startx.  Apparently this is the effect 
> of the first instruction in http://wiki.debian.org/Xmonad,
> "... add 
> STARTUP=x-window-manager
> to your ~/.xsessionrc."

That is one way.  That overrides the value determined by the
/etc/X11/Xsession.d/50x11-common_determine-startup script.
And there are other ways.

This way is good because it is personal for you and doesn't affect
others and works across boxes.

> A second strategy would be to find a way to raise the priority 
> of xmonad.  If my original speculation above is correct, this 
> might be achieved by de-installing both alternatives and 
> reinstalling in the desired order.

We have been here before:

  http://lists.debian.org/debian-user/2012/07/msg00897.html

I suggested then and now:

  # update-alternatives --config x-window-manager

Or in scripted batch mode:

  # update-alternatives --set x-window-manager /usr/bin/xmonad

Order only matters among alternatives of the same priority.

> Alternatively, by using update-alternatives directly.

Either this (configuring update-alternatives) or setting it in your
dot files is probably better.

> update-alternatives --remove x-window-manager /usr/bin/xmonad
> update-alternatives --install x-window-manager x-window-manager 
> /usr/bin/xmonad 100

Although that works, and it is your own system so go ahead if you feel
like it, this won't be preserved when packages are installed and
upgraded since they will have new package postinst scripts and won't
know to preserve your changes since the changes will be marked as
system automatic.  But if you use --config or --set then they will be
marked as manual and they will.  So I think --config or --set is the
better way to go.  Or probably best is setting up your local files
with something like STARTUP or similar above.

Some time ago I posted this in a discussion about the Debian
alternatives and it includes a walkthrough of how alternatives are
used and configured.  I think it is still relevant.

  http://lists.debian.org/debian-user/2002/08/msg02808.html

Bob

Attachment: signature.asc
Description: Digital signature

Reply via email to