perf: Home-manager to module
feat: Optionise config
This commit is contained in:
14
modules/user/packages/drvs/ags/widget/elements/Battery.tsx
Normal file
14
modules/user/packages/drvs/ags/widget/elements/Battery.tsx
Normal file
@ -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>
|
||||
}
|
Reference in New Issue
Block a user