17 lines
349 B
TypeScript
17 lines
349 B
TypeScript
import { Variable } from "astal";
|
|
import computeCPU from "./helpers";
|
|
|
|
export default function Cpu() {
|
|
const cpu_usage = Variable<string>("").poll(5000, () => computeCPU());
|
|
|
|
return (
|
|
<box className="cpu">
|
|
<label
|
|
className="Cpu"
|
|
onDestroy={() => cpu_usage.drop()}
|
|
label={cpu_usage()}
|
|
/>
|
|
</box>
|
|
);
|
|
}
|