feat: started working on waybar

This commit is contained in:
Pihkaal
2024-02-08 00:40:51 +01:00
parent e778631828
commit 71ab32c53a
18 changed files with 203 additions and 5 deletions

View File

@@ -0,0 +1,16 @@
import { WaybarWidget } from "../WaybarWidget";
import { randomMinMax } from "~/utils/math";
// TODO: find a good idea to determine disk usage
export const WaybarDiskWidget = (props: {
current: number;
variation: number;
capacity: number;
}) => {
const value =
props.current + randomMinMax(-props.variation, props.variation + 1);
const usage = Math.round((value / props.capacity) * 100);
return <WaybarWidget>󰋊 {usage}%</WaybarWidget>;
};