diff options
author | Jasper Ras <jras@hostnet.nl> | 2024-11-28 10:03:42 +0100 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2024-11-28 10:03:42 +0100 |
commit | 7f729d18d9d85f914b6cb1f4df81207caeee4b61 (patch) | |
tree | 76bc911d06112b6ca7593fec83b4ed48bea8cde7 /widget/Battery.tsx |
init
Diffstat (limited to 'widget/Battery.tsx')
-rw-r--r-- | widget/Battery.tsx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/widget/Battery.tsx b/widget/Battery.tsx new file mode 100644 index 0000000..d1b70d6 --- /dev/null +++ b/widget/Battery.tsx @@ -0,0 +1,12 @@ +import Battery from "gi://AstalBattery" +import { bind } from "astal" + +export default function BatteryPercentage() { + const bat = Battery.get_default() + + return <box> + <button onClick="echo hello" /> + <label label="hi" /> + <label label={bind(bat, "percentage").as((p) => p * 100 + "%")} /> + </box> +} |