feat(waybar): tooltips

This commit is contained in:
2024-08-15 17:52:01 +02:00
parent 515db924d0
commit 5dacaffa16
13 changed files with 172 additions and 35 deletions

View File

@@ -24,7 +24,16 @@ export const WaybarRAMWidget = (props: {
return () => clearInterval(interval);
});
const used = (usage / 100) * props.capacity;
// TODO: tooltip
// Memory - (capacity * usage).1f GB used
return <WaybarWidget className="px-[0.625rem]"> {usage}%</WaybarWidget>;
return (
<WaybarWidget
className="px-[0.625rem]"
tooltip={`Memory - ${used.toFixed(1)}GB used`}
>
{usage}%
</WaybarWidget>
);
};