.xinitrc for XFce patch suggestion

Benedikt Meurer Benedikt.Meurer at unix-ag.uni-siegen.de
Fri Jun 20 10:43:30 CEST 2003


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.

> 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.

> 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 basic shell syntax
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.

regards,
Benedikt

-- 
NetBSD Operating system:                       http://www.NetBSD.org/
pkgsrc "Work in progress":                  http://pkgsrc-wip.sf.net/
XFce desktop environment:                        http://www.xfce.org/
German Unix-AG Association:                   http://www.unix-ag.org/



More information about the Xfce4-dev mailing list