[FreeNX-kNX] running suspended?

Kurt Pfeifle k1pfeifle at gmx.net
Fri Sep 30 12:12:55 UTC 2005


On Wednesday 28 September 2005 08:51, Dirk Mueller wrote:

> I'm wondering if there is a way for an x application (say: kscreensaver) to 
> detect if it is running currently in a suspended (!) NX session. 

NoMachine NX servers keep track of the state of sessions in files 

  /usr/NX/var/db/running/{running,failed,closed}/sessionID{......}

FreeNX (recent versions) does it in

  /var/lib/nxserver/db/running/{running,failed,closed}/sessionID{......}

However, these files are only accessible for user "nx" (permissions 0600)
so I think this is ruled out for your purpose.

Currently, probably the most simple test is to do an "echo $DISPLAY",
and if it says a figure above 1000 ("unix:1011.0"), it is very likely
you are in an NX session. However this is no certain thing -- this
is a configurable option and is only true for default installations.

We would probably need a mutually agreed standard indicator for such
a thing.

It would be nice if KDE (or other desktops for that matter) would be
aware of the fact that they are running inside an NX session, and 
modify some of their behaviour based on that knowledge. One thing that
comes to mind immediately is a logout option that then includes 
termination or suspension of the NX session.

> I'm kinda  
> annoyed seeing suspended NX sessions eating up CPU time because of a 
> screensaver that keeps nxagent busy. 

From what I guess this is less of a problem if you run the NX session
in windowed mode: here you could switch off the screensaver for the 
NX session completely, and rely on the client's main window screensaver 
to cover the NX window too, right?

For fullscreen mode, this will not work. As a workaround, you could
try to switch back to windowed with [alt]+ctrl]+[f] whenever you leave
your desk... but I'm sure you will find that annoying too.

> Please CC, I'm not subscribed. 

Done.

Cheers,
Kurt 




More information about the FreeNX-kNX mailing list