diff options
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> +} |