.xinitrc for XFce patch suggestion

Benedikt Meurer Benedikt.Meurer at unix-ag.uni-siegen.de
Thu Jun 19 20:00:43 CEST 2003


On Thu, 19, Jun 2003, Ric wrote:

> Hi all:

Hello Ric,

Just a note: I don't see any reason to login to a desktop environment
using the root account. There are thousands of better ways of getting
things done. One possible way: Just install sudo, or use the sudo
that shipped with your system (e.g. with OpenBSD).

> This is it with comments.  Only the section for loading
> xscreensaver(XSS) is included here.
> 
> # Launch xscreensaver, if available
> # xscreensaver -no-splash -lock-mode &
> ##use a test for existence first + do not start w/ locking
> if $USER=root
> ## this eliminates a lot of *stuff*, e.g., that ... message
> from JZ
> 
> if [ -x /usr/X11R6/bin/xscreensaver ] 
> then
>    if [ $UID = 0 ] 
>    	then	##root's logged in
> 			##test if xss is already running
> 			if [ '/sbin/pidof xscreensaver' > 0 ]

This has two important problems:

	1) pidof is not available on most unix systems!
	2) xscreensaver might be running on a different host, or maybe
	   several screensavers are running on this host, but none of
	   them connected to the current display. You should always keep
	   in mind, that X is a distributed system; altough you might
	   use only one host and only one X display, others (like me)
	   have several hosts using various X displays.

> 			then	##xss is already running, which ALWAYS seems to be
> true
> 					##true in Mandrakesoft v9.0
> 			## write an 'info' message-will be in ~/.xsession-errors
> 			echo "XSS is already running."
> 			## nothing is appropriate 2B here -'cept maybe? return 0
> or break -?
>    		else				
> 			## root's logged in but xss is not running
> 			## start it (with splash & no lock as UID=nobody)
> 			## note:locking only works when xscreensaver is launched
> by a
> 			## normal,non-privileged user(e.g., not "root"; root pid
> is always=0.)
> 	   	xscreensaver &		
>   			fi	# it was already running or was just started
>    	else	## root is NOT logged-in
> 		## can start xss but kill it b/4 start
> 		xscreensaver-command -exit	
> 		##start it as $USER 
> 		xscreensaver -no-splash -lock-mode &	
>    fi
> fi
> ##EndXSS
>
> Comments?  

See above.

> Ric

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