.xinitrc for XFce patch suggestion

Ric fhj52ads at yahoo.com
Fri Jun 20 20:51:52 CEST 2003


Hey Matthew Weier OPhinney:
--- Matthew Weier OPhinney
<matthew-lists at weierophinney.net> wrote:
> -- Ric <fhj52ads at yahoo.com> wrote
> (on Thursday, 19 June 2003, 06:47 PM -0700):
> > Excellent questions. 
> > 
> > --- Olivier Fourdan <fourdan at xfce.org> wrote:
> <snip> 
> > > - How does that work with other than bash shells ?
> > 
> > As for other than sh, which ones? csh/tsch, ch...?
> > The script as it is now, is only for sh which, on MDK,
is
> > bash.
> 
> A proper 'sh' script will utilize POSIX standards; as
> such, it should
> run on any POSIX-compliant shell. That's the important
> thing. I believe
> there's some documents over at tldp.org that will explain
> which
> commands, tests, and expansions are POSIX compliant.
> 

Thanks!   

The short: for POSIX compliance, one should use bash, not
sh. AFAIK,  sh  does not make any claim to POSIX compliance
but  I have only made cursory looks at a man page for  sh.
The script does  assume  sh  is  bash  because I have no
experience with sh directly and because that seems to be
the normal thing in Linux.  The  BAsh  is an implementation
of Bourne sh and has always worked great here.  I know that
it is "too big and too slow" but are not all
shells/shell-scripts?

The long:
Perhaps you can explain: bash is POSIX compliant (since
2.0) for 
" IEEE POSIX Shell and Tools specification (IEEE Working
Group 1003.2) " - well, it is supposed to be and I cannot
say otherwise.          Even if it is invoked with the name
sh, bash is supposed to comply(from man bash).  The only
diff I know about is when it reads startup (rc) files
although I have read that there are some other subtle
diff's. 
 
For POSIX compliance, the only 2 problems I see (using
sh=bash) is that some systems may have  sh  and not use 
bash  for  sh , in which case the first line 
#!/bin/sh  
could/should be  
#!/bin/bash 
to mandate "bash" and its implementation of POSIX
compliance.  
The other problem is that, of course,  #!/bin/bash  would
make systems that do not have  bash  installed cough,  if
there are any with  sh  but not  bash.  I do not have any
info about how many systems which could run XFce4, would
have  sh installed but would not have  bash  installed.  If
it is a significant number, then using  #!/bin/bash  is not
such a good idea.  E.g., I have never used FreeBSD, NetBSD,
and OpenBSD so I really do not know if  bash  is std on
those *nix systems.
(oh yea, I just thought:  there are also issues of whether
the system has at least  bash 2.0  or if somebody sets
bash=sh in the environment but I am not going there...)
BTW,  /bin/bash --posix   forces POSIX compliance where a
deviation might exist which is good if POSIX compliance is
necessary.  

So, if I am using only  bash  (2.0)commands in a shell
script, why would I need something else for POSIX even if
the script is called using  sh?   Seriously. I do not know.

I do know that the script may need an adjustment to use a 
sh  compliant  command. E.g.,  " [ "  may need to be
changed to " test " and the  "]" removed.  I am waiting a
bit to see what might be the choice about changing the XSS
part of the  xinitrc  script before venturing there since I
cannot test that as   sh  only at this time( /bin/sh ->
bash ).  The " test " works, AFAICT.

> <snip>
> > Oh, I agree.  But, frankly, if it was up to me, I would
> > remove the lines 
> > 
> > # Launch xscreensaver (if available)
> > xscreensaver -no-splash &
> > 
> > from the XFce4 xinitrc file completely and force the
> end
> > user to make a conscious decision as to whether run the
> > monitor all the time and hopefully it will be a
> > conscientious decision.   
> 
> I agree completely with this; I don't use xscreensaver
> because it uses
> too many resources (I use xlock instead), but it *is* on
> my system for
> others to use. 

I also have it on the system but that is only because MDK
put it in the Requires for XFce(3) and I was too lazy at
the time of install to get the sources, change the spec(s),
rebuild and reinstall.  That may change this weekend...


> 
> The real point here is that the XFce4 xinitrc file should
> only load
> those items *specific* to XFce/wm4, and provide a
> commented area for
> explaining where to load other programs (or,
> alternatively, explain
> about the Desktop/Autostart directory and its usage).
> 

Oh I agree there too but (apparently) so many others want
XSS running at startup that it was included in the  xinitrc
 sh  script.  It was a nice thing to do, ithink.  Since,
ithink, it needs to be running for xflock to work properly
with XSS, it is sort-of necessary for XFce & xinitrc is a
good place for it --  of course I don't really know since I
do not use it now or ever have used it very much.  I did
play with it some years back but that was when OpenGL did
not work so good(arguably my fault) and, also, nVidia did
not have any drivers for Linux so it was _way_ too much
trouble then.


> -- 
> Matthew Weier O'Phinney
> http://weierophinney.net/matthew/

I have not found anything about sh and POSIX at LDP yet but
there are some interesting comments about UNIX:
http://tldp.org/LDP/LG/issue32/issue32.txt



=====
Have A Great Day!

Ric
***

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com



More information about the Xfce4-dev mailing list