jadoba on 20 Oct 2006 14:21:19 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] Re: 'ifconfig eth0 down' on mouse/kbd being idle


sorry if i skipped anyone:

From: "George Gallen" <ggallen@slackinc.com>
>What if you set the BIOS to use power management,
> and include the ethernet (if onboard) for shutdown on sleep?

It doesnt seem this is a feature on my motherboard


From: "Mark Baker" <mrkbkr@gmail.com>
>You may want to take a look at some of the group computing scripts such as
>SETI that run when your computer is idle or an open source screen saver
>script that you could use the code from.  I did a quick search and found a
>few such as "idleize" which you may be able to use for your own script.

from what I can tell, idleize uses cpu usage (or rather a lack thereof)
as a 
trigger for starting/ending the processes, not mouse/kbd idleness


From: "Mark Baker" <mrkbkr@gmail.com>
>Actually running a simple w or who command with an awk statement would let
>you see the idle time of each user on the system.

equinox:~ # w
 09:42:53 up 25 days, 13:13, 11 users,  load average: 0.53, 0.29, 0.16
USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
jadoba   :0        24Sep06 ?xdm?   9:51m  0.02s -:0               
jadoba   pts/0     24Sep06 25days  5.25s 15.92s xterm
jadoba   pts/3     24Sep06  1.00s  0.50s  3:52  xterm
-snip-

the ?xdm? stays there regardless of the idle time. all the rest are
xterms


From: "George Gallen" <ggallen@slackinc.com>
>Have a cron job every minute look for :0 and if the time
>is more than you want, then do the ifconfig, only problem
>is when you want it to come back up, it might take a minute
>for the next cron instance to realize the idle time now less
>than to bring up eth0

This would be a fix if w reported the idle time for :0


From: gyoza@comcast.net
>What about using screen blanking/saver as a trigger?  Re-activation
>could be manual.

This I can imagine is plausible, perhaps using if statements and the
'ps' command with grep to trigger the ifconfig command whenever it
notices xscreensaver has been called. I haven't tested wether or not
xscreensaver shows up in output of ps after it starts, however. same
thing with seti, which I don't run, and if I did, it might seem a bit
like a conflict of interests to run seti and also take down my internet
connection every time i idle.


From: gabriel rosenkoetter <gr@eclipsed.net>

>The "run a cron job once a minute" techniques seem like a huge waste
>of resources to me.

I dont think running a ps command with grep every minute would be
anywhere near a huge waste of resources... but i agree that it's not an
optimal solution

>You want to be hooking into something that's already polling for
>human I/O events (if this were NetBSD, I'd say "wscons") and
>registering (and then renewing later) a timer on them which, if
>expired takes action.
>
>Maybe the Linux distribution involved makes use of something like
>SCIM:
>
> http://www.scim-im.org/
>
>which looks like it probably provides some hooks for monitoring
>keydown/keyup mousedown/mouseup.

I'll have to check that one out tonight

>Another decent place to look is the XScreenSaver source; checking
>the same places it does for I/O information should work, and you
>could run the process that checks and downs/ups the interface in the
>same way (automatically forking and sitting in the background till
>an exit request is passed to it later).

I don't know what the xscreensaver is coded in, but i'd bet that I don't
know the language.


From: "Mark Baker" <mrkbkr@gmail.com>

>There are some simple utilities that can be called for some of the linux
>distros that give kb mouse idle times.   What distro are we working with?

oh, sorry. Open SuSE 10.0


thanks for all the suggestions so far guys

-jim

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug