Re: [off-topic] How to auto-run xlock?

1999-04-09 Thread Branden Robinson
On Wed, Apr 07, 1999 at 10:49:07PM -0600, Rick Macdonald wrote:
 I have a program that I want to run only while my PC is unattended. I
 don't need the screen locked necessarily.
 
 xlock does this for me:
 
 xlock +nolock -startCmd startsetiathome -mode blank
 
 but I have to run it manually. When I log back in, it does kill the
 running command (startsetiathome) just like I want.
 
 I'd like this exact behaviour but somehow I need xlock to always be
 running, waiting to jump in after the idle period.
 
 Any ideas? Do any of the screen savers in gnome/enlightenment/etc have
 such features?

How about the xautolock package?  It might more properly be named
xidle, since it is simply used to start an arbitrary command after the X
input devices have been idle for the period of time you determine.

Package: xautolock
Status: install ok installed
Priority: optional
Section: non-free/x11
Installed-Size: 47
Maintainer: Frederic Lepied [EMAIL PROTECTED]
Version: pl15-1
Depends: libc6, xlib6g (= 3.3-5)
Recommends: xlockmore | xtrlock
Description: Start a program if the X window is idle for some time
 Xautolock monitors console activity under the X window system, and
 fires up a program of your choice if nothing happens during a
 user configurable period of time. You can use this to automatically
 start up a screen locker in case you tend to forget to do so manually
 before having a coffee break.

Urp.  That's not free!  I just noticed that and I've been using it for
years.

Looks like we do need xidle.  Who wants to write it?

Guess I should install vrms and find out what else I'm in trouble with.

-- 
G. Branden Robinson  |
Debian GNU/Linux |If existence exists,
[EMAIL PROTECTED]   |why create a creator?
cartoon.ecn.purdue.edu/~branden/ |


pgpLXfMrM4c1x.pgp
Description: PGP signature


Re: [off-topic] How to auto-run xlock?

1999-04-09 Thread Rick Macdonald
On Fri, 9 Apr 1999, Branden Robinson wrote:

 On Wed, Apr 07, 1999 at 10:49:07PM -0600, Rick Macdonald wrote:
  I have a program that I want to run only while my PC is unattended. I
  don't need the screen locked necessarily.

 How about the xautolock package?

Ah, that's what I was asking for! But, I like the /proc/interrupts
solution better now. It gives me a Tcl-only capability, and will work even
if X isn't running.

I may later need a solution for Solaris and other platforms, and xautolock
is the only one I have so far. Thanks!

 Urp.  That's not free!  I just noticed that and I've been using it for
 years.

It's almost free. There's even a note in the copyright field quoting the
author saying it should be ok for debian releases. There must be still
some detail that the DFSG doesn't like.

...RickM...


[off-topic] How to auto-run xlock?

1999-04-08 Thread Rick Macdonald

I have a program that I want to run only while my PC is unattended. I
don't need the screen locked necessarily.

xlock does this for me:

xlock +nolock -startCmd startsetiathome -mode blank

but I have to run it manually. When I log back in, it does kill the
running command (startsetiathome) just like I want.

I'd like this exact behaviour but somehow I need xlock to always be
running, waiting to jump in after the idle period.

Any ideas? Do any of the screen savers in gnome/enlightenment/etc have
such features?

If anyone is interested, the program that I'm running is the SETI at Home
client. SETI is The Search for Extraterrestrial Intelligence.

Linux platforms currently dominate the user community, but the Mac and
Windows clients aren't released yet.

Check it out: http://setiathome.ssl.berkeley.edu/

Here's a screenshot of a little GUI monitor that I wrote for it:

http://www.cuug.ab.ca/~macdonal/tkseti.gif

...RickM...


Re: [off-topic] How to auto-run xlock?

1999-04-08 Thread E.L. Meijer \(Eric\)
 
 
 I have a program that I want to run only while my PC is unattended. I
 don't need the screen locked necessarily.
 
 xlock does this for me:
 
 xlock +nolock -startCmd startsetiathome -mode blank
 
 but I have to run it manually. When I log back in, it does kill the
 running command (startsetiathome) just like I want.
 
 I'd like this exact behaviour but somehow I need xlock to always be
 running, waiting to jump in after the idle period.

I thought about this problem before, and now realised you can check
keyboard and mouse activity looking at /proc/interrupts.  You could then
start a script like this in your .xsession file (adapt the variables at
the start to your needs):

runsaver:

#! /bin/sh

# these are the interrupts of your keyboard and mouse,
# check out your /proc/interrupts:
INTERRUPTS=1 4

# this is the interval in seconds between checks of /proc/interrupts
SLEEPTIME=30

# if more than MAXINTERVALS * SLEEPTIME seconds pass without activity,
# the xlock program will run
MAXINTERVALS=10

# command line options for xlock
XLOCKFLAGS=-nolock -mode bat

checkactive () {
  TOTALS=
  INTERVALS=0 
  while true; do
OLDTOTALS=$TOTALS
TOTALS=
for x in $INTERRUPTS; do
  TOTALS=$TOTALS `grep \$x: /proc/interrupts | \
   sed -e 's/^.*: *\([0-9]*\).*/\1/'`
done
if [ $TOTALS = $OLDTOTALS ]; then
  INTERVALS=`expr $INTERVALS + 1`
  if [ $INTERVALS -ge $MAXINTERVALS ]; then
break
  fi
else
  INTERVALS=0
fi
sleep $SLEEPTIME
  done
}

while true; do
  checkactive
  xlock $XLOCKFLAGS
done



Note I have only just barely tested this.

 If anyone is interested, the program that I'm running is the SETI at Home
 client. SETI is The Search for Extraterrestrial Intelligence.

Great, sent my regards to the aliens once you find them :)

HTH,
Eric

-- 
 E.L. Meijer ([EMAIL PROTECTED])
 Eindhoven Univ. of Technology
 Lab. for Catalysis and Inorg. Chem. (SKA)


Re: [off-topic] How to auto-run xlock?

1999-04-08 Thread Rick Macdonald
On Thu, 8 Apr 1999, E.L. Meijer (Eric) wrote:

  I'd like this exact behaviour but somehow I need xlock to always be
  running, waiting to jump in after the idle period.
 
 I thought about this problem before, and now realised you can check
 keyboard and mouse activity looking at /proc/interrupts.  You could then
 start a script like this in your .xsession file (adapt the variables at
 the start to your needs):

This is great! Thanks! I don't even need xlock now. I'll just start/stop
the SETI program directly.

Now, does anybody know if there is an equivalent to the /proc files on
other UNIXs, particularly Solaris, to detect mouse and keyboard activity?

...RickM...


Re: [off-topic] How to auto-run xlock?

1999-04-08 Thread Hamish Moffatt
On Thu, Apr 08, 1999 at 08:06:51AM -0600, Rick Macdonald wrote:
 This is great! Thanks! I don't even need xlock now. I'll just start/stop
 the SETI program directly.
 
 Now, does anybody know if there is an equivalent to the /proc files on
 other UNIXs, particularly Solaris, to detect mouse and keyboard activity?

Shouldn't nicing it to the lowest level mean it only runs in idle time
anyway? Or does it display things when running?


Hamish
-- 
Hamish Moffatt VK3TYD. 
CCs of replies from mailing lists are welcome.


Re: [off-topic] How to auto-run xlock?

1999-04-08 Thread Rick Macdonald
On Fri, 9 Apr 1999, Hamish Moffatt wrote:

 On Thu, Apr 08, 1999 at 08:06:51AM -0600, Rick Macdonald wrote:
  This is great! Thanks! I don't even need xlock now. I'll just start/stop
  the SETI program directly.
  
  Now, does anybody know if there is an equivalent to the /proc files on
  other UNIXs, particularly Solaris, to detect mouse and keyboard activity?
 
 Shouldn't nicing it to the lowest level mean it only runs in idle time
 anyway? Or does it display things when running?

I need to try various nice values and pay more attention, but I could
feel it's presence when it's running at nice=1. It's all numerical
computation and soaks up lots of CPU. Memory isn't a problem for me (I
have 256MB). It doesn't display anthing, just a stream of progress prints
to stdout that you can /dev/null.

...RickM...


Re: [off-topic] How to auto-run xlock?

1999-04-08 Thread Michael Stenner
On Thu, 8 Apr 1999, Rick Macdonald wrote:

On Fri, 9 Apr 1999, Hamish Moffatt wrote:
 Shouldn't nicing it to the lowest level mean it only runs in idle time
 anyway? Or does it display things when running?

I need to try various nice values and pay more attention, but I could
feel it's presence when it's running at nice=1. It's all numerical

nice=19 is the LOWEST priority, nice=-20 is the HIGHEST.  Negative
numbers are only available to root.  So, when you moved it from 0 to 1,
you didn't really do all that much.  Try sending it all the way to 19.

-Michael

computation and soaks up lots of CPU. Memory isn't a problem for me (I
have 256MB). It doesn't display anthing, just a stream of progress prints
to stdout that you can /dev/null.


  Michael Stenner   Office Phone: 919-660-2513
  Duke University, Dept. of Physics   [EMAIL PROTECTED]
  Box 90305, Durham N.C. 27708-0305


Re: [off-topic] How to auto-run xlock?

1999-04-08 Thread Rick Macdonald
On Thu, 8 Apr 1999, Michael Stenner wrote:

 I need to try various nice values and pay more attention, but I could
 feel it's presence when it's running at nice=1. It's all numerical
 
 nice=19 is the LOWEST priority, nice=-20 is the HIGHEST.  Negative
 numbers are only available to root.  So, when you moved it from 0 to 1,
 you didn't really do all that much.  Try sending it all the way to 19.

The default is 1. I did set it to 19 for awhile, but not long enough to
decide if I could live with it that way for 2 years. Once the novelty
wears off, I figure running it only when I'm away from the PC will be
plenty good enough.

The program checkpoints state, so you can kill and restart it at will
without loosing anything. Of course, you could just stop/cont it as well.

The [EMAIL PROTECTED] sever is down right now so I can't do any more tests at 
the
moment.

...RickM...