mirror of
https://github.com/tuxdotrs/tpanel.git
synced 2025-10-10 12:51:54 +05:30
17 lines
383 B
TypeScript
17 lines
383 B
TypeScript
import { bind } from "astal";
|
|
import AstalBattery from "gi://AstalBattery";
|
|
|
|
export const Battery = () => {
|
|
const battery = AstalBattery.get_default();
|
|
|
|
return (
|
|
<box cssClasses={["pill"]} visible={bind(battery, "isPresent")}>
|
|
<label
|
|
label={bind(battery, "percentage").as(
|
|
(p) => `Bat: ${Math.floor(p * 100)}%`,
|
|
)}
|
|
/>
|
|
</box>
|
|
);
|
|
};
|