working bar

This commit is contained in:
Bloxx12 2025-04-21 09:35:17 +02:00
commit 2c9ff9db2f
8 changed files with 121 additions and 126 deletions

14
widget/battery.tsx Normal file
View 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
cssClasses={["Battery"]}
visible={bind(bat, "isPresent")}>
<image iconName={bind(bat, "batteryIconName")} />
<label label={bind(bat, "percentage").as(p => `${Math.floor(p * 100)}%`)} />
</box>
}