[Grml] A scheme to manage several ZSH config file collections?

Richard Hartmann richih.mailinglist at gmail.com
Thu Jul 24 13:48:43 CEST 2008


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 have had a few ideas in this direction and would like to discuss
those here. New suggestions are more than welcome as well, of course.
Ideally, the same versions should be usable on the machines of whoever
maintains those files, so that changes can be merged back and forth
easily, which will allow more people to participate.


1) Make ZSH load the RC files from different paths (/etc/zsh/config1 ..)
    Pro: Almost drop-in, minimal work necessary
         Cleanly seperated
         Different ttys might run with different RC files
    Con: Needs modification to fpath etc
         Shells can not be allowed to start prior to rc file selection

2) Use symlinks
    Pro: Fast to set up
    Con: All shells are forced to use the same RC files
         Shells can not be allowed to start prior to rc file selection
         Ugly & hackish

3) Use $ZSHRC_PREFIX or some similar variable
    Pro: Drop-in solution once you change your RC files for the first
           time
         Cleanly seperated
         Different ttys might run with different RC files
    Con: Shells can not be allowed to start prior to rc file selection
         Needs a way for ZSH to be started with a variable set before it
           is invoked

Are there any other options? Pros or Cons I overlooked? Anything else?
The main thing I worry about is to make the shells wait for their RC
files in a robust & fail-safe way?

Personally, I lean towards solution 3, but I am not hell-bent onto using
it.


Thanks,
Richard

PS: Yes, in a second step, this system could be expanded for VIM
etc, as well.



More information about the Grml mailing list