-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathright.jsx
37 lines (33 loc) · 1.01 KB
/
right.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
import DateTime from './lib/DateTime/index.jsx';
import Battery from './lib/Battery/index.jsx';
import Cpu from './lib/Cpu/index.jsx';
import Memory from './lib/Memory/index.jsx';
import Hdd from './lib/Hdd/index.jsx';
import Wifi from './lib/Wifi/index.jsx';
import Error from './lib/Error/index.jsx';
import { rightSide } from './lib/style.jsx';
import parse from './lib/parse.jsx';
export const refreshFrequency = 15000
export const command = './powerbar/status-right.sh'
export const render = ({output}) => {
console.log(`Right bar output: ${output}`);
const data = parse(output);
if (typeof data === 'undefined') {
return (
<div style={rightSide}>
<Error msg="Error: unknown script output" side="right"/>
</div>
)
}
return (
<div style={rightSide}>
<Wifi output={data.wifi}/>
<Hdd output={data.hdd}/>
<Memory output={data.memory}/>
<Cpu output={data.cpu}/>
<Battery output={data.battery}/>
<DateTime output={data.datetime}/>
</div>
)
}
export default null