Santhosh
Santhosh

Reputation: 21

Is there a way to get battery level using unix c program

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

Upvotes: 2

Views: 1096

Answers (3)

Sudhanshu
Sudhanshu

Reputation: 2871

Peeking into apcupsd may be useful.

Upvotes: 0

pib
pib

Reputation: 3323

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

Upvotes: 1

kjagiello
kjagiello

Reputation: 8410

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/

Upvotes: 0

Related Questions