Files
Dotfiles/roles/ags/files/lib/battery.ts
Keule0010 8aa6bcd5cb Added ags
TODO copy ags config
2024-04-16 00:28:26 +02:00

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",
})
})
}