Merge branch 'main' of git.mcorangehq.xyz:XOR64/dim
This commit is contained in:
commit
3b68f2dfda
12
build.sh
Normal file
12
build.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
set -xe
|
||||
mkdir -p modules
|
||||
|
||||
CCARGS="-Isrc/include -Wall -pedantic"
|
||||
|
||||
cc -o dim src/main.c src/plug.c $CCARGS -lX11 -ldl
|
||||
cc -o modules/clocky.dim src/modules/clock.c -rdynamic -shared -fPIC $CCARGS
|
||||
cc -o modules/battery.dim src/modules/battery.c -rdynamic -shared -fPIC $CCARGS
|
||||
|
||||
|
|
@ -35,6 +35,7 @@ void plug_init(void) {
|
|||
void plug_reload(void) { /* Unused */ }
|
||||
|
||||
void plug_poll(char* buf, size_t len) {
|
||||
if (!fp) return;
|
||||
int perc = 0;
|
||||
fseek(fp, 0, SEEK_SET);
|
||||
fscanf(fp, "%d", &perc);
|
||||
|
|
Loading…
Reference in New Issue
Block a user