tags:

views:

112

answers:

3

is there any way to create a daemon in unix that would monitor my battery level and notify me after the crtical level. and is there any way to identify a node that is joining and leaving a network using c

+1  A: 

It may be a good start for you: http://ubuntuforums.org/showthread.php?t=367978

acpi -b

ACPI project: http://www.lesswatts.org/projects/acpi/

Balon
A: 

As a solution to both problems (and assuming by "unix" you mean "Linux"), you could look into using DBus: http://www.freedesktop.org/wiki/Software/dbus

I know Ubuntu has daemons running by default which trigger DBus events when network connections change and there are standard endpoints for things like current battery charge.

Look for information on DBus network manager and perhaps try this project for the power monitoring portion: http://powersave.sourceforge.net/powersave/DBus.html

pib
A: 

Peeking into apcupsd may be useful.

Sudhanshu