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

Re: [E-devel] battery-module: run an command on alarm



On Wed, 21 Jun 2006 23:00:30 +0200 Stephan Wezel <s.wezel@arcor.de> babbled:

> Hi,
> i have written a patch with which the battery-module can run an command
> on alarm.
> E.g when the battery drops under 10 min remaining time then you
> can initiate the shutdown of the system.
> 
> the command is currently executet via the system-fn call. If it is
> there a better methode to do it then let me know it.
> 
> Regards
> 
> Stephan Wezel

i actually didn't want to do this. running a command is powerful- but not very
user friendly. the fact is that this feature appeared for a reason - to shut
down, suspend or such given a condition. being able to shut down, suspend etc.
from e directly is already a desired thing - but this requires punching holes
into root access, and i haven't done that yet. but the proper solution (imho)
is to do this (provide e calls in e itself to exit e, restart e, logout,
shutdown, reboot, suspend, hibernate etc.) then provide a simple config dialog
of "at X% battery do: nothing, warning dialog, shutdown, suspend, ... etc.". as
a user should not have to know some obscure incantation to have something like
this work. it should be a simple choice. then e will take care of doing that
specific action. (as doing it your way a user needs to figure out how to give
themselevs root access - sudoers, or whatever) and do it in a non-interactive
way for these specific commands, then actually know these commands etc. i'd
rather push that off int an abstracted api and a system config that defines
what these special suid root helper commands do (the system, admin or
distribution would define it in a system config or at compile time so it works
with the way their system works - this is specially needed for suspend and
hibernate at the moment as there are many different ways to do that currently
unlike shutdown and reboot which are standard)

> -- 
> Ein Ring, sie zu knechten, sie alle zu finden,
> Ins Dunkel zu treiben und ewig zu binden
> Im Lande Mordor, wo die Schatten drohn.


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    raster@rasterman.com
裸好多
Tokyo, Japan (東京 日本)