dzen2: Modify dzen-extras, update Makefile and recipe.
authorAlex Ferguson <thoughtmonster@gmail.com>
Mon, 15 Nov 2010 19:07:12 +0000 (21:07 +0200)
committerKristoffer Ericson <kristoffer.ericson@gmail.com>
Mon, 15 Nov 2010 19:19:25 +0000 (20:19 +0100)
Modularized the battery applet by moving the charge calculation
in an external script and adding per-platform functions. Made the
process a bit more efficient by adding a small program written in
C, dzen-battery, which calculates a battery percentage given two
standard files in /sys/class/power_supply and by moving processes
outside the main loop when they only need to run once.

Modified Makefile for dzen-battery.c

Bumped PR on dzen2-svn

Signed-off-by: Alex Ferguson <thoughtmonster@gmail.com>
Signed-off-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
recipes/dzen2/dzen2_svn.bb
recipes/dzen2/files/Makefile
recipes/dzen2/files/dzen-extras.tar.gz

index 893a577..fa10724 100644 (file)
@@ -5,7 +5,7 @@ RDEPENDS = "ttf-dejavu-sans xrandr"
 
 SRCREV = "271"
 PV = "0.8.5+svnr${SRCPV}"
-PR = "r1"
+PR = "r2"
 
 SRC_URI = "svn://dzen.googlecode.com/svn/;module=trunk;proto=http \
           file://dzen-extras.tar.gz \
index 4e3525a..4bafbcb 100644 (file)
@@ -6,7 +6,7 @@ include config.mk
 SRC = draw.c main.c util.c action.c
 OBJ = ${SRC:.c=.o}
 
-all: options dzen2
+all: options dzen2 dzen-battery
 
 options:
        @echo dzen2 build options:
@@ -24,6 +24,10 @@ dzen2: ${OBJ}
        @echo CC -o $@
        @${CC} -o $@ ${OBJ} ${LDFLAGS} ${LIBS}
 
+dzen-battery: dzen-battery.c
+       @${CC} -c ${CFLAGS} dzen-battery.c
+       @${CC} -o dzen-battery dzen-battery.o ${LDFLAGS}
+
 clean:
        @echo cleaning
        @rm -f dzen2 ${OBJ} dzen2-${VERSION}.tar.gz
@@ -43,6 +47,8 @@ install: all
        @chmod 755 ${DESTDIR}${PREFIX}/bin/dzen2
        @cp -f dzen-launcher ${DESTDIR}${PREFIX}/bin
        @chmod 755 ${DESTDIR}${PREFIX}/bin/dzen-launcher
+       @cp -f dzen-battery ${DESTDIR}${PREFIX}/bin
+       @chmod 755 ${DESTDIR}${PREFIX}/bin/dzen-battery
        @echo installing scripts to ${DESTDIR}${PREFIX}/share/dzen
        @mkdir -p ${DESTDIR}${PREFIX}/share/dzen/scripts
        @cp -f scripts/* ${DESTDIR}${PREFIX}/share/dzen/scripts
index d571714..7a10757 100644 (file)
Binary files a/recipes/dzen2/files/dzen-extras.tar.gz and b/recipes/dzen2/files/dzen-extras.tar.gz differ