xbattmon

simple battery monitor for X
git clone git://git.2f30.org/xbattmon
Log | Files | Refs | README | LICENSE

commit aac487e084a93e547e3b9b4eb04054350d284ef5
parent 67b41d7e2374abf724be33abb4c5f8c3c694ebd6
Author: sin <sin@2f30.org>
Date:   Fri, 13 May 2016 09:49:20 +0100

Revert "Move platform spec. macros from *.mk to xbattmon.c"

This reverts commit fc019739005f332931990ac375234689392a5805.

Move configuration back to config.mk.  As an example PATH_AC_ONLINE
might have to be changed depending on the system.

Diffstat:
Mconfig.bsd.mk | 2+-
Mconfig.dfly.mk | 2+-
Mconfig.linux.mk | 3++-
Mxbattmon.c | 7-------
4 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/config.bsd.mk b/config.bsd.mk @@ -1,7 +1,7 @@ PREFIX = /usr/local MANPREFIX = $(PREFIX)/man -CPPFLAGS = -DVERSION=\"${VERSION}\" +CPPFLAGS = -DVERSION=\"${VERSION}\" -DPATH_APM=\"/dev/apm\" CFLAGS = -I/usr/X11R6/include LDFLAGS = -L/usr/X11R6/lib LDLIBS = -lX11 diff --git a/config.dfly.mk b/config.dfly.mk @@ -1,7 +1,7 @@ PREFIX = /usr/local MANPREFIX = $(PREFIX)/man -CPPFLAGS = -DVERSION=\"${VERSION}\" +CPPFLAGS = -DVERSION=\"${VERSION}\" -DPATH_APM=\"/dev/apm\" CFLAGS = -I/usr/local/include ${CPPFLAGS} LDFLAGS = -L/usr/local/lib LDLIBS = -lX11 diff --git a/config.linux.mk b/config.linux.mk @@ -1,5 +1,6 @@ PREFIX = /usr/local MANPREFIX = $(PREFIX)/share/man -CPPFLAGS = -DVERSION=\"${VERSION}\" +CPPFLAGS = -DVERSION=\"${VERSION}\" -DPATH_BAT_CAP=\"/sys/class/power_supply/BAT0/capacity\" \ + -DPATH_AC_ONLINE=\"/sys/class/power_supply/AC/online\" LDLIBS = -lX11 diff --git a/xbattmon.c b/xbattmon.c @@ -216,8 +216,6 @@ redraw(void) #include <fcntl.h> #include <machine/apmvar.h> -#define PATH_APM "/dev/apm" - void pollbat(void) { @@ -247,8 +245,6 @@ pollbat(void) #include <fcntl.h> #include <machine/apm_bios.h> -#define PATH_APM "/dev/apm" - void pollbat(void) { @@ -269,9 +265,6 @@ pollbat(void) close(fd); } #elif __linux__ -#define PATH_BAT_CAP "/sys/class/power_supply/BAT0/capacity" -#define PATH_AC_ONLINE "/sys/class/power_supply/AC/online" - void pollbat(void) {