Can my FreeRunner remind me to shut it down if it is still running at 22:00?
edorfaus at xepher.net
Sat Jul 25 06:21:28 CEST 2009
Brolin Empey wrote:
> 2009/7/24 Robin Paulson <robin.paulson at gmail.com>
>> 2009/7/25 Brolin Empey <brolin at brolin.be>:
>>> I prefer to shut down my cell phone before going to bed, but I frequently
>> it may be easier to schedule a cron job which shuts the phone down for
>> you. sounding an alarm to remind you to do something the phone can do,
>> sounds like it's missing the point
> I may be using the phone at 22:00, though, in which case I do not want it to
> automatically shut down. :)
Well, there are ways around that, too.
As an example, your script could start by popping up an xmessage on the
screen asking the user if he wants to shut down now, with a No button
that stops the process, and a timeout in case the user isn't there.
Then, it could call shutdown with a delay (e.g. shutting down in 5
minutes instead of now), this will send a message to users logged in via
other ways than X (e.g. via ssh), and can also be cancelled. The user
would then have 5 minutes to cancel the shutdown (using shutdown -c),
after that it would shut down on its own.
Of course, similar methods could be used to just give a reminder as
well. E.g., use an audio player (aplay, ogg123, ...) to make a sound,
and pop up a message similar to the one above (though perhaps without
timeout, just the Yes/No buttons, or just OK if you want it manual).
I'll admit to not being very up on current events though, so there might
be better ways of doing those things (playing sound, showing
message/question, shutting down) in the framework, instead of the common
*nix utilities I'm considering.
More information about the community