mirror of
https://github.com/tuxdotrs/tpanel.git
synced 2025-10-11 13:21:55 +05:30
feat: initial commit
This commit is contained in:
15
widget/bar/battery.tsx
Normal file
15
widget/bar/battery.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
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>
|
||||
);
|
||||
};
|
Reference in New Issue
Block a user