repo.or.cz
/
dockapps.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
wmix: added appropriate message and fall back if user's color for OSD failed
[dockapps.git]
/
wmacpiload
/
src
/
battest.c
blob
924177fab80df3989bfb209c1d4d8c71a7552eef
1
#include <stdio.h>
2
3
int
i
;
4
FILE
*
fd
;
5
int
temp
;
6
char
*
buf
;
7
8
9
main
() {
10
buf
=(
char
*)
malloc
(
sizeof
(
char
)*
512
);
11
for
(
i
=
0
;
i
<
20000
;
i
++) {
12
if
((
fd
=
fopen
(
"/proc/acpi/battery/BAT0/state"
,
"r"
))) {
13
bzero
(
buf
,
512
);
14
fseek
(
fd
,
57
,
0
);
15
fscanf
(
fd
,
"charging state: %s"
,
buf
);
16
17
printf
(
"We are at loop %d and charging is %s
\n
"
,
i
,
buf
);
18
fclose
(
fd
);
19
}
20
}
21
free
(
buf
);
22
}
23