开发者

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 crtic开发者_Go百科al level. and is there any way to identify a node that is joining and leaving a network using c


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


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/


Peeking into apcupsd may be useful.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜