ags: To derivation

This commit is contained in:
Sweetbread committed 2025-01-25 19:38:13 +03:00
1 parent 290b694877
commit e46c205fe3
15 files changed
+24 -5

No files matched your search

@@ -0,0 +1,14 @@
import { bind } from "astal"
import Battery from "gi://AstalBattery"
export default function BatteryLevel() {
const bat = Battery.get_default()
return <box className="Battery"
visible={bind(bat, "isPresent")}>
<icon icon={bind(bat, "batteryIconName")} />
<label label={bind(bat, "percentage").as(p =>
`${Math.floor(p * 100)} %`
)} />
</box>
}