From: yawnmoth on
I'd like to make it so my computer turns off after 12h of inactivity.
Any ideas as to how I might go about doing this?
From: Loki Harfagr on
Sat, 03 Oct 2009 20:26:07 -0700, yawnmoth did cat :

> I'd like to make it so my computer turns off after 12h of inactivity.
> Any ideas as to how I might go about doing this?

you'll need to first define inactivity, as to its
own "eye" a computer is always 'active'.
From: yawnmoth on
On Oct 4, 5:24 am, Loki Harfagr <l...(a)thedarkdesign.free.fr.INVALID>
wrote:
> Sat, 03 Oct 2009 20:26:07 -0700, yawnmoth did cat :
>
> > I'd like to make it so my computer turns off after 12h of inactivity.
> > Any ideas as to how I might go about doing this?
>
> you'll need to first define inactivity, as to its
> own "eye" a computer is always 'active'.

No keyboard or mouse movements. Like how a screensaver defines no
activity.
From: Rikishi42 on
On 2009-10-04, yawnmoth <terra1024(a)yahoo.com> wrote:

> I'd like to make it so my computer turns off after 12h of inactivity.
> Any ideas as to how I might go about doing this?

12h without any login, no problem.

12h of inactivity... The machine is allways doing something or other.
If you're the only user on the machine, you could check that no processes
are running under your name, but even that wouldn't work because you can
have a cron job running. Or you would be logged in graphically, in which
case there a allways a number of processes running under your name.


If all else fails, you could make a kind of dead man's break I guess.

--
Any time things appear to be going better, you have overlooked
something.
From: Loki Harfagr on
Sun, 04 Oct 2009 08:12:59 -0700, yawnmoth did cat :

> On Oct 4, 5:24 am, Loki Harfagr <l...(a)thedarkdesign.free.fr.INVALID>
> wrote:
>> Sat, 03 Oct 2009 20:26:07 -0700, yawnmoth did cat :
>>
>> > I'd like to make it so my computer turns off after 12h of inactivity.
>> > Any ideas as to how I might go about doing this?
>>
>> you'll need to first define inactivity, as to its own "eye" a computer
>> is always 'active'.
>
> No keyboard or mouse movements. Like how a screensaver defines no
> activity.

OK, then it'd be a matter of "watching these devices"

(meanwhile
I'd say the best would be to do it "physically", something like
using a live plug with a countdown, or even make up a
kitchen clockwork you'd re-rotate its head when you're still
here/living/awaken ;-)

Now, on the IT level I suppose there are many existing tools
but if, as I suppose, your question was about how to try and
do it for fun here's a possible idea on the way I [cw]ould do it:

prepare a script to be launched as root in you favorite
init.d or rc.d file which would consist on
loops that'd "test and set" your input devices when used,
quick example here for mouse:
------------
while true;do dd if=/dev/input/mice of=/dev/shm/_tinkle bs=1 count=1 &>/dev/null;done &
------------

then, a simple crontab entry would trigger the nap attack, e-g:
easy test:
------------
find /dev/shm/ -type f -name _tinkle -mmin +3 -exec echo "BOUH" \;
------------

or, in your case:
------------
find /dev/shm/ -type f -name _tinkle -mmin +720 -exec halt \;
------------
 |  Next  |  Last
Pages: 1 2
Prev: Bash history weirdness
Next: KDE and Gnome