Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: A scheme to manage several ZSH config file collections?



"Richard Hartmann" wrote:
> Hi all,
> 
> some of you might be aware of grml, a live boot CD which uses ZSH as its
> default shell. I suggested integrating several different zshrc files
> along with whatever other files they need and offer the user a selection
> of said configuration files.
> 
> Now, we are wondering if there is a clean and maintainable way to do
> this.

I don't know enough about this set-up to be able to answer this properly.
I presume the system is strictly booting and configuring from CD only,
so every time you boot you get to pick choices from scratch (i.e. every
time it looks like the user has been freshly created), however I don't
know how things are stored once the system is running.

You later refer to "for the first time"... I presume you mean that
although the stuff needs doing each time you boot from the CD, later
instances of the shell will pick up the same settings?  Do you have a
writeable home area for the user in which .zshrc files can be copied for
this?  In that case, the zsh/newuser module added to the main line (and
in recent 4.3 releases) should be something like what you want, since it
runs if there are no existing user startup files.  You may well want to
adapt the zsh-newuser-install function to your own ends: you can simply
write a drop-in replacement for this without altering the core of the
system---it's been designed with this in mind.  You can simply get
zsh-newuser-install to write a .zshrc that sources the appropriate
selected set of files, or copy in as much or as little code and
comments as you want.  Then the user can just edit the .zshrc.

Presumably there's somewhere to save this stuff, in that case you should
be able to use this system just by setting ZDOTDIR appropriately, since
zsh/newuser will respect this.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



Messages sorted by: Reverse Date, Date, Thread, Author