mirror of
https://github.com/tuxdotrs/tpanel.git
synced 2025-10-10 04:41:55 +05:30
16 lines
395 B
TypeScript
16 lines
395 B
TypeScript
import { bind } from "astal";
|
|
import AstalBattery from "gi://AstalBattery";
|
|
|
|
export const Battery = () => {
|
|
const battery = AstalBattery.get_default();
|
|
|
|
return (
|
|
<box visible={bind(battery, "isPresent")}>
|
|
<image iconName={bind(battery, "batteryIconName")} />
|
|
<label
|
|
label={bind(battery, "percentage").as((p) => `${Math.floor(p * 100)}%`)}
|
|
/>
|
|
</box>
|
|
);
|
|
};
|