working bar
This commit is contained in:
parent
ed206ad7e5
commit
2c9ff9db2f
8 changed files with 121 additions and 126 deletions
14
widget/battery.tsx
Normal file
14
widget/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
|
||||
cssClasses={["Battery"]}
|
||||
visible={bind(bat, "isPresent")}>
|
||||
<image iconName={bind(bat, "batteryIconName")} />
|
||||
<label label={bind(bat, "percentage").as(p => `${Math.floor(p * 100)}%`)} />
|
||||
</box>
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue