mirror of
https://github.com/xsghetti/HyprCrux.git
synced 2025-07-03 13:50:38 -04:00
17 lines
422 B
JavaScript
17 lines
422 B
JavaScript
|
|
import icons from "./icons.js"
|
|
|
|
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",
|
|
})
|
|
})
|
|
}
|