[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Priorities of alternatives; was Re: Re (2): xmonad and LXDE.



peasthope@shaw.ca writes:

> 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 packager chooses the priority.  The alternative provided is
installed (by calling update-alternatives --install) from the package
postinst.

> 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.  
>

Run update-alternatives --config x-window-manager to set your
preference.  You don't need to mess with priority.  It only decides what
will be selected automatically when packages are installed/removed.  If
you override by running update-alternatives --config, then the priority
has no effect.

> 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."
>
> 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.  Alternatively, by using 
> update-alternatives directly.
>
> update-alternatives --remove x-window-manager /usr/bin/xmonad
> update-alternatives --install x-window-manager x-window-manager /usr/bin/xmonad 100
>
> This would give xmonad top priority system wide and should work 
> for a display manager as well as for startx.  Comments welcome.
>

I recommend you don't run update-alternatives --remove or --install for
this purpose.  For most sysadmins, --config should be sufficient.

-- 
regards,
kushal


Reply to: