mirror of
https://github.com/tuxdotrs/tpanel.git
synced 2025-10-11 05:11:55 +05:30
feat: split scss and rename widget folder to widgets
This commit is contained in:
14
widgets/bar/battery.tsx
Normal file
14
widgets/bar/battery.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { bind } from "astal";
|
||||
import AstalBattery from "gi://AstalBattery";
|
||||
|
||||
export const Battery = () => {
|
||||
const battery = AstalBattery.get_default();
|
||||
|
||||
return (
|
||||
<box cssClasses={["battery"]} visible={bind(battery, "isPresent")}>
|
||||
<label
|
||||
label={bind(battery, "percentage").as((p) => `${Math.floor(p * 100)}%`)}
|
||||
/>
|
||||
</box>
|
||||
);
|
||||
};
|
Reference in New Issue
Block a user