Re: Start GNUstep.sh as early as possible in Xwindow session

2006-04-17 Thread Charles Philip Chan
On Sun, 16 Apr 2006 23:32:41 -0700
Yen-Ju Chen [EMAIL PROTECTED] wrote:

 I wonder anyone has a better solution,
 like automatically running GNUstep.sh if it is run before ?

It looks like you are running it instead of sourcing it, ie:

   source /usr/GNUstep/System/Library/Makefiles/GNUstep.sh

Mine is sourced from /etc/profile.d (in this special case, just
symlink the file to it), but of course you can use ~/.profile, or
~/xinitirc. The difference between ~/.profile and ~/.bashrc is that
~/.profile only runs once when logging in as opposed to ~/.bashrc
which runs every time you invoke a new shell.

Charles 

-- 
printk(KERN_EMERG PCI: Tell willy he's wrong\n);
linux-2.6.6/arch/parisc/kernel/pci.c


signature.asc
Description: PGP signature
___
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep


Re: Start GNUstep.sh as early as possible in Xwindow session

2006-04-17 Thread Chris Vetter
On 2006-04-17 10:01:26 +0200 Charles Philip Chan [EMAIL PROTECTED] 
wrote:
The difference between ~/.profile and ~/.bashrc is that ~/.profile 
only runs once when
logging in as opposed to ~/.bashrc which runs every time you invoke a 
new shell.


Yes, but not every shell looks for (and reads in) the .profile file in 
your home.


--
Chris



___
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep


Re: Start GNUstep.sh as early as possible in Xwindow session

2006-04-17 Thread Tima Vaisburd
 Yen-Ju Chen [EMAIL PROTECTED] wrote:
  I wonder anyone has a better solution,
  like automatically running GNUstep.sh if it is run before ?

Tima Vaisburd wrote:

 I put the line
   source path-to-GNUstep/System/Library/Makefiles/GNUstep.sh
 in my ~/.bash_profile

On Monday 17 April 2006 01:01, Charles Philip Chan wrote:
 On Sun, 16 Apr 2006 23:32:41 -0700

 It looks like you are running it instead of sourcing it, ie:

source /usr/GNUstep/System/Library/Makefiles/GNUstep.sh

 Mine is sourced from /etc/profile.d (in this special case, just
 symlink the file to it)

Yes, having symlink in /etc/profile.d is even better since this is
for every user, but one still needs to make sure the files inside
/etc/profile.d are source'd.

In my system they are sourced from /etc/profile, which, in turn,
is sourced by a login shell, so I had to make the X session create one.

Tima


___
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep


Re: Start GNUstep.sh as early as possible in Xwindow session

2006-04-17 Thread Charles Philip Chan
On Mon, 17 Apr 2006 10:41:51 +0200
Chris Vetter [EMAIL PROTECTED] wrote:

 Yes, but not every shell looks for (and reads in) the .profile file
 in your home.

Yes you are correct, Do you know of any shell other than t/csh that does
not read ~/.profile?

Charles

-- 
printk(KERN_ERR %s: Something Wicked happened! %4.4x.\n,...);
linux-2.6.6/drivers/net/sundance.c


signature.asc
Description: PGP signature
___
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep


Re: Start GNUstep.sh as early as possible in Xwindow session

2006-04-17 Thread Chris Vetter
On 2006-04-17 11:09:16 +0200 Charles Philip Chan [EMAIL PROTECTED] 
wrote:
Yes you are correct, Do you know of any shell other than t/csh that 
does not read ~/.profile?


For example, the ZSH doesn't even read /etc/profile, nor does it read 
~/.profile. By default it's /etc/zprofile and ~/.zprofile instead. 
Only if zsh is invoked in [k]sh compatibility mode, it will read the 
former two.


--
Chris




___
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep


Re: Start GNUstep.sh as early as possible in Xwindow session

2006-04-17 Thread Charles Philip Chan
On Mon, 17 Apr 2006 00:56:40 -0700
Tima Vaisburd [EMAIL PROTECTED] wrote:

 I modified the first line of this script to be
 
 #!/bin/bash --login
 
 This way it reads $HOME/.bash_profile (but _not_ $HOME/.bashrc)
 so I put the line
 
source path-to-GNUstep/System/Library/Makefiles/GNUstep.sh
 
 in my ~/.bash_profile

You have to do this manually? Doesn't the default ~/.xsession of your
distro source the profile files? Mine has the following lines:

 
# Read system and user profile if not already done
#
if test -z $XSESSION_IS_UP ; then
readonly XSESSION_IS_UP=yes
export XSESSION_IS_UP
test -r /etc/profile  { . /etc/profile  /dev/null 21 ; }
set +u  /dev/null 21
test -r ${HOME}/.profile  { . ${HOME}/.profile  /dev/null 21 ; }
set +u  /dev/null 21
fi

#
# Read the profile of tcsh users
#
case $SHELL in
*/csh|*/tcsh)
while read env ; do
var=${env%%=*} ; val=${env#*=}
test $var = umask   umask $val
test $var = $valcontinue
eval export $var=\$val
done  ($SHELL -c 'test -r /etc/csh.login  source /etc/csh.login;
test -r $HOME/.loginsource $HOME/.login  ;
printenv; echo -n umask=; umask')
;;
esac


which does that.

Charles

-- 
panic(Attempted to kill the idle task!);
linux-2.2.16/kernel/exit.c


signature.asc
Description: PGP signature
___
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep


RE: Start GNUstep.sh as early as possible in Xwindow session

2006-04-17 Thread Vaisburd, Haim
Charles Philip Chan wrote:

 Do you know of any shell other than t/csh that does not read
~/.profile?

bash does not read ~/.profile if it finds ~/.bash_profile

Just a note: bash (and, maybe, some other popular shells)
distinguishes between
1. interactive login shell
2. interactive, but not login shell
3. non-interactive shell

The files it reads upon initialization differ in all 3 cases.
So I should have written something like when bash is going
to read user profile file, it first goes for ~/.bash_profile,
and if it finds it, it does not read any more user profile files.

I found that on many system a display manager (xdm) starts a shell
that is not interactive at all, so neither ~/.bashrc nor ~/.bash_profile
is read before the system X session script ( Xsession ) is executed.
This might explain why sourcing GNUstep.sh in ~/.bashrc had no effect
on applications launched in Xsession.


Tima.


___
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep


Re: Start GNUstep.sh as early as possible in Xwindow session

2006-04-17 Thread Charles Philip Chan
On Mon, 17 Apr 2006 11:30:09 -0700
Vaisburd, Haim [EMAIL PROTECTED] wrote:

 bash does not read ~/.profile if it finds ~/.bash_profile

Yes, you are correct. To expand on this if ~/.bash_profile does not
exist, it will source ~/.bash_login. If ~/.bash_login does not exist,
it will source ~/.profile.

Charles

-- 
panic(do_trap: can't hit this);
linux-2.6.6/arch/i386/mm/extable.c


signature.asc
Description: PGP signature
___
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep


RE: Start GNUstep.sh as early as possible in Xwindow session

2006-04-17 Thread Vaisburd, Haim
Yen-Ju Chen wrote:

 As a regular user, I cannot even understand why there is a
.bash_profile, .bash_rc and .profile.

As a GNUstep developer, you can easily understand it after you
read INVOCATION section in the manual page for bash :)
My only advise is to stick with just one shell (bash is ok),
because every shell slightly differs, and here the real mess comes.

With bash:

~/.profile is a junk, delete it
~/.bash_rc is an ERROR, it should be ~/.bashrc,
  the former will never be used

The rationale behind having two init files instead of one is,
as far as I get,
that some stuff (environment variables, umask) is inherited
by subshell and you do not want to make that stuff executed in
the subshell again. So environment goes to ~/.bash_profile,
non-inheritable stuff (e.g. aliases) - to ~/.bashrc


 And for Xwindow, there is .xinitrc and .xsession, and some others
 system installed script (/etc/X11/Xsession.d/ in Ubuntu).

~/.xinitrc and/or ~/.xsession are normally source'd by
system-wide session initialization scripts - on my gentoo
distro it is /etc/X11/xdm/Xsession, and I believe on Ubuntu
it's quite the same. My Xsession uses only ~/.xsession,
if it exists.

I also believe that Xsession script goes
into /etc/X11/Xsession.d/ and sources every file in there.
This is done for better modularity, the same techinque
applies to bash initiaization: /etc/profile looks
into /etc/profile.d/

Tima


___
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep


Re: Start GNUstep.sh as early as possible in Xwindow session

2006-04-17 Thread Yen-Ju Chen
On 4/17/06, Christopher Armstrong [EMAIL PROTECTED] wrote:
 I've been messing alot with .xsession and .xinitrc lately, and from what
 I can work out these are executed depending on how you use X (please
 check manuals before relying on this information, as I may be wrong).

 .xinitrc is supposed to be called when you start X from a terminal with
 the xinit command, so it's likely to be ignored by a session manager.

 .xsessionrc is supposed to be used by your session manager (xdm, gdm,
 kdm or wdm). I believe xdm uses this file in preference to the
 system-wide ones (/etc) if it exists. gdm, etc. have specific behaviour
 i.e. whether you set the session when you login or tell it to use your
 default session (.xsessionrc). They may even override it if you change
 your default session (I'm not sure though), which could be your
 .xsessionrc.

 The man pages on xsession and xinit are interesting in this regard, and
 I recommend looking at them (inc. those for gdm/kdm/xdm).

After some investigation,
I figure out there is another problem of saving GNUstep applictaion in session.
I may be wrong, but based on my observation,
gnome-session save GNUstep application as unix command,
ex. GNUstep/Local/Applications/AnApp.app/AnApp.
Next time, it tries to start the application based on this command and
will fail.
By changing the saved command into 'openapp AnApp.app' will solve the problem.
I guess GNUstep application just don't support Xwindow session yet.

Yen-Ju


 Regards
 Chris



 ___
 Discuss-gnustep mailing list
 Discuss-gnustep@gnu.org
 http://lists.gnu.org/mailman/listinfo/discuss-gnustep



___
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep