Priorities of alternatives; was Re: Re (2): xmonad and LXDE.
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? 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. 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. ... Peter E. -- 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12 Tel +13606390202 Bcc: peasthope at shaw.ca http://carnot.yi.org/ http://members.shaw.ca/peasthope/index.html#Itinerary -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/171057907.37139.24988@cantor.invalid
Re: Priorities of alternatives; was Re: Re (2): xmonad and LXDE.
peasth...@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 -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/50fb91f4.a4d1440a.301a.c...@mx.google.com
Re: Priorities of alternatives; was Re: Re (2): xmonad and LXDE.
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 signature.asc Description: Digital signature