ags
This commit is contained in:
parent
eddf7cecb8
commit
aea798d119
16631 changed files with 1480363 additions and 257 deletions
16
home/ags/lib/battery.ts
Normal file
16
home/ags/lib/battery.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
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",
|
||||
})
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue