mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2025-12-12 11:36:20 +00:00
17 lines
464 B
TypeScript
17 lines
464 B
TypeScript
import icons from "./icons"
|
|
|
|
export default async function init() {
|
|
const bat = await Service.import("battery")
|
|
bat.connect("notify::percent", ({ percent, charging }) => {
|
|
const low = 30
|
|
if (percent !== low || percent !== low / 2 || !charging)
|
|
return
|
|
|
|
Utils.notify({
|
|
summary: `${percent}% Battery Percentage`,
|
|
iconName: icons.battery.warning,
|
|
urgency: "critical",
|
|
})
|
|
})
|
|
}
|