> -----Original Message-----
> From: [EMAIL PROTECTED] 
> 
> Hi,
> 
> I'm looking for an automated way to disconnect idle SunRay 
> sessions after a specific time (maybe via a cron job).  As a 
> possible measurement mechanism, I am considering using 
> lastDeviceEventParameter from the x session 
> (http://blogs.sun.com/roller/page/alanc?entry=an_idle_hack).  
> Is this a reasonable approach or is there a 'preferred' 
> approach?  What are others doing?

Since we are using KDE here this is what I am doing:

The facility that actually spawns off the screensaver is
$KDEDIR/bin/kdesktop_lock. I renamed that to kdesktop_lock.orig and
wrote a wrapper script for it which I saved as kdesktop_lock (see script
below).

I created a special "share" directory tree elsewhere on the file system
with its own kdesktoprc file. I used kiosk mode to force the settings
(i.e. users cannot override them). See contents below (the [$i] entries
are the forced ones).

> cat kdesktoprc
[ScreenSaver]
DPMS-dependent=false
Enabled[$i]=true
Lock[$i]=true
Priority[$i]=19
Saver=KClock.desktop
Timeout[$i]=2700


And in my startkde script I use $KDEDIRS (note the trailing 'S') to add
this config to the mix. 


-- Russ


> cat $KDEDIR/bin/kdesktop_lock
#!/usr/local/bin/perl
use strict; use warnings; use Data::Dumper;

# Since all of our ICA clients are runnig under some other OS/desktop
# what is the point of running a screensaver in an ICA session!?!
exit 0 if exists $ENV{CITRIX_SESSION_ID};

#_SUN_SUNRAY_CONN_INFO(STRING) = "IX=0 AD=10.1.40.68 PN=53482
PAD=10.1.40.68 PPN=53482 [EMAIL PROTECTED],0 MTU=1500"
#_SUN_SUNRAY_CONN_INFO(STRING) = "IX=0 AD= PN=-1 PAD= PPN=-1
[EMAIL PROTECTED],0 MTU=1500"
#_SUN_SUNRAY_CONN_INFO:  no such atom on any window.
if( exists $ENV{SUN_SUNRAY_TOKEN} ) {
        my $xprop = `/usr/openwin/bin/xprop -root
_SUN_SUNRAY_CONN_INFO`;
        exit 0 if $xprop =~ /PN=-1 PAD= PPN=-1/; # Disconnected session
so no need for a screensaver
        exec '/opt/SUNWut/bin/utdetach' if( $ENV{SUN_SUNRAY_TOKEN} =~
/(^auth\.)|(^escape\.)/ );
        }

# Okay then lets go ahead and run the real kdesktop_lock
exec "$ENV{KDEDIR}/bin/kdesktop_lock.orig --forcelock";





_______________________________________________
SunRay-Users mailing list
[email protected]
http://www.filibeto.org/mailman/listinfo/sunray-users

Reply via email to