summaryrefslogtreecommitdiff
path: root/widget/Battery.tsx
diff options
context:
space:
mode:
authorJasper Ras <jras@hostnet.nl>2024-11-28 10:03:42 +0100
committerJasper Ras <jras@hostnet.nl>2024-11-28 10:03:42 +0100
commit7f729d18d9d85f914b6cb1f4df81207caeee4b61 (patch)
tree76bc911d06112b6ca7593fec83b4ed48bea8cde7 /widget/Battery.tsx
init
Diffstat (limited to 'widget/Battery.tsx')
-rw-r--r--widget/Battery.tsx12
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>
+}