discuss-gnustep
[Top][All Lists]
Advanced

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

Re: $GNUSTEP_DEFAULTS_DIR not set/exported in GNUstep.sh


From: Nicola Pero
Subject: Re: $GNUSTEP_DEFAULTS_DIR not set/exported in GNUstep.sh
Date: Fri, 30 Jul 2004 08:49:40 +0100 (BST)

> This is a problem for me because I am working on improving WindowMaker's 
> GNUstep integration. If $GNUSTEP_USER_DIR is set to ~, by default the 
> Defaults/ directory is in the users' homedir, which is ugly. I place it in 
> ~/Library, which, incidentally is also where it is in OS X (Except it's 
> named Preferences).
> 
> By default, WindowMaker puts its' defaults file in 
> $GNUSTEP_USER_DIR/Defaults this path is hardcoded in serveral place in the 
> WM source as $GSDIR/Defaults (when $GNUSTEP_USER_DIR is set, 
> $GSDIR=$GNUSTEP_USER_DIR) This is bad. However, in WindowMaker's defense, 
> since the $GNUSTEP_DEFAULTS_DIR is /never/ set by default, it has no way 
> of currently doing anything else. If we make this envvar exported by 
> default (as $GNUSTEP_DEFAULTS_DIR=$GNUSTEP_USER_DIR/Defaults) then I will 
> be able to make WindowMaker respect this properly.
> 
> Nicola, can we pretty-please do this? I don't see any disadvantage, as 
> long as the default for the envvar is set to the same place as it is now 
> without it (namely, $GNUSTEP_USER_DIR\Defaults).

Well the theory is ... that it is a bit more complex than this.

The theory is that any user can change the location of the defaults by
editing a .GNUsteprc file in their home directory.

The defaults location is usually only used by gnustep-base, so
gnustep-base reads that file to determine where the defaults should be.

Setting GNUSTEP_DEFAULTS_DIR in GNUstep.sh would require running user_home
defaults to get the defaults location from ~/.GNUsteprc, which is slow,
and no program (we thought) would use it, so we avoid doing this
altogether.  Also, GNUstep.sh might disappear completely so if you can do
without relying much on shell variables, that would be healthy. :-)

This is complicated by the fact that I'm not sure the .GNUsteprc
implementation is (well) documented or (well) tested :-)

Anyway, there are various solutions to this --

 1. have window maker detect and parse ~/.GNUsteprc.  You can probably
copy code from user_home.c (assuming licenses are compatible of course).  
If a defaults directory is set there, use it.  If a gnustep user directory
is set there, append Library/Defaults/ and use it.  Else, just use
~/GNUstep/Library/Defaults/ (I think, check what the default is).

 2. I'm not sure I understand your description because when you talk of
GNUSTEP_USER_DIR I'm not sure if you're referring to GNUSTEP_USER_ROOT or
to something else, but presumably it shouldn't be difficult to change
WindowMaker to save preferences in GNUSTEP_USER_ROOT/Library/Defaults
instead of GNUSTEP_USER_ROOT/Defaults.  Just look for all the locations
where that happens and change them.  This might be a temporary solution, 
but since we might switch away from shell variables soon and the final 
architecture of the switch is not quite completely clear yet, temporary 
solutions might be good for now.

Thanks





reply via email to

[Prev in Thread] Current Thread [Next in Thread]