.xinitrc for XFce patch suggestion
Ric
fhj52ads at yahoo.com
Fri Jun 20 23:02:52 CEST 2003
Hi Benedikt:
Thanks again.
--- Benedikt Meurer <Benedikt.Meurer at unix-ag.uni-siegen.de>
wrote:
> On Thu, 19, Jun 2003, Ric wrote:
>
> > Hello Benedikt:
>
> Hello Ric,
>
> > # Launch xscreensaver (if available)
> > if [ -x /usr/X11R6/bin/xscreensaver ]
> > then ## XSS exists
> > if [ $UID -gt 0 ]
> > then ## root is not logged in
> > xscreensaver -no-splash &
> > fi
> > fi
>
> Only one problem left: xscreensaver may not be installed
> in /usr/X11R6/bin
> (but for example in /usr/bin/X11 or /opt/<whatever>).
> Then your check
> will fail although xscreensaver is installed. You may
> want to look at
> the xfce update script how this could be done.
Ok. I did consider that because I know that it is not
normally(from the tarbgz) installed there.
The summary: that can be circumvented in many different
ways but all will add complexity to the .xinitrc file.
- I have worked around the path thing with another program
before and can find(or rewrite) the fix that will find XSS
and parse the results so that regardless of where XSS might
be on the system, the path to it will be correct; sed...
but that slows things down a bit and adds the complication
that find/grep/sed might not be on the system for some
weird reason, etc.
- JZ puts xscreensaver in a number of different locations
based on the system types but I have to go with the
comments for Solaris:
" And thanks for moving things around again, too. "
That's not so unusual. We might leave it up to a distro or
the SysAdmin to massage xinitrc to the *special*
location. Xfree, in their .xintrc file says that's the
thing to do( i do not rem the exact words but basically
"this is a SAMPLE - FIX it!").
- we could add all the known options with ||(a sh builtin),
e.g. :
if test -x /usr/local/screensaver/xscreensaver || test -x
/usr/X11R6/bin/xscreensaver || test -x
/opt/screensaver/xscreensaver || test -x
/usr/bin/X11/xscreensaver || test -x <whatever>...
That's a little hard but it would be _much_ faster than
searching all the system paths for a bin/xscreensaver
whenever XFce4 starts( & better 'cause it may not be in a
"/bin/" as with /opt). The XSS standard
$(install_prefix)$(bindir) can be determined + add whatever
you et al know from experience. If xscreensaver is in a
non-standard location the SysAdmin should know about it and
realize that a 'fix' is required. IOW, IMO, it is not up
to XFce4 .xinitrc to find it although that's a *nice*
thing to do for the underappreciated, underpaid and
overworked *nix SysAdmins. The disadvantage is surely that
install locations do change and that would require
attention to the .xinitrc file to adjust with the times.
I will look for/at the "update script" too( mañana - I have
a water heater to install tonight ). I was using XFce4
from an install with the (modified)SRPMS so I do not have
the "update script"(presuming you mean for CVS) but will
look there. Thanks for the tip.
> > I did a little testing here and that resolves the basic
> > problems since XSS will not be asked to start when
> $UID<=0.
> > Do you think it might be better to use a test $UID
> != 0
> > ?
>
> UIDs are positive (>= 0) integer numbers. Therefore your
> -gt 0 test is ok.
That's good. I really do not like exact tests anyway.
>
> > Of course, the above only works as is for sh compatible
> > shells = bash.
>
> The above works for "sh compatible shells", yes, although
> bash is not a sh compatible shell (bash is mostly
compatible).
>
> > I do not know what the current shell is for
> > other *nix. I thought sh and bash were generally the
> > standard for all the *nix but I had not given much
> > thought to it before.
>
> sh is the standard shell for nearly every Unix system,
> bash is the
> standard shell with nearly every Linux distribution. You
> can assume,
> that every system has a (mostly POSIX compabitle)
> /bin/sh, atleast the bash symlink work-around. If you use
only
> only basic shellsyntax
> and commands that are defined in POSIX.2 (and for example
> "[" is really a separate program, not a shell builtin).
>
> Some Unix systems (notable SVR4 system) have no POSIX sh
> installed, but
> instead use ksh in POSIX compatibility mode, which is ok,
> as long as you use only basic shell syntax as suggested.
>
I have looked at a Unix sh man page today and while there
is no mention of " [ ", it does mention " test " which [I
presume] means that the program " test " is probably more
common, so:
if test -x /usr/X11R6/bin/xscreensaver
then
if test $UID -gt 0
<blah>
might be better.
> regards,
> Benedikt
>
The "test" might help a bit to be more compatible with
*nix. Yes?/No?
=====
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