forked from kkga/nibar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stats.jsx
67 lines (59 loc) · 1.51 KB
/
stats.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import Weather from "./lib/weather.jsx";
import DateTime from "./lib/DateTime.jsx";
import Battery from "./lib/Battery.jsx";
import Cpu from "./lib/Cpu.jsx";
import Wifi from "./lib/Wifi.jsx";
// import Dnd from "./lib/Dnd.jsx";
// import Netstats from "./lib/Netstats.jsx";
import Error from "./lib/Error.jsx";
import parse from "./lib/parse.jsx";
import styles from "./lib/styles.jsx";
const style = {
color: styles.colors.dim,
fontFamily: styles.fontFamily,
fontSize: styles.fontSize,
lineHeight: styles.lineHeight,
fontWeight: styles.fontWeight
}
const date = {
width: "100vw",
display: "flex",
justifyContent: "center",
}
const stats = {
display: "grid",
padding: "0 12px",
gridAutoFlow: "column",
gridGap: "24px",
position: "fixed",
overflow: "hidden",
right: "0px",
top: "0px",
};
export const refreshFrequency = 10000;
export const command = "./nibar/scripts/stats.sh";
export const render = ({ output }) => {
const data = parse(output);
if (typeof data === "undefined") {
return (
<div style={style}>
<Error msg="Error: unknown script output" side="right" />
</div>
);
}
// <Netstats output={data.netstats} />
return (
<div style={style}>
<div style={date}>
<DateTime output={data.datetime} />
</div>
<div style={stats}>
<Wifi output={data.wifi} />
<Cpu output={data.cpu} />
<Battery output={data.battery} />
<Weather output={data.weather} />
</div>
</div>
);
};
export default null;