mirror of https://github.com/lcpz/lain.git
Merge pull request #418 from cool-cool-sweat/full_notify
bat: allow disabling notification for full charge
This commit is contained in:
commit
93b31ef0e9
|
@ -30,6 +30,7 @@ local function factory(args)
|
||||||
local args = args or {}
|
local args = args or {}
|
||||||
local timeout = args.timeout or 30
|
local timeout = args.timeout or 30
|
||||||
local notify = args.notify or "on"
|
local notify = args.notify or "on"
|
||||||
|
local full_notify = args.full_notify or notify
|
||||||
local n_perc = args.n_perc or { 5, 15 }
|
local n_perc = args.n_perc or { 5, 15 }
|
||||||
local batteries = args.batteries or (args.battery and {args.battery}) or {}
|
local batteries = args.batteries or (args.battery and {args.battery}) or {}
|
||||||
local ac = args.ac or "AC0"
|
local ac = args.ac or "AC0"
|
||||||
|
@ -198,7 +199,7 @@ local function factory(args)
|
||||||
}).id
|
}).id
|
||||||
end
|
end
|
||||||
fullnotification = false
|
fullnotification = false
|
||||||
elseif bat_now.status == "Full" and not fullnotification then
|
elseif bat_now.status == "Full" and full_notify == "on" and not fullnotification then
|
||||||
bat.id = naughty.notify({
|
bat.id = naughty.notify({
|
||||||
preset = bat_notification_charged_preset,
|
preset = bat_notification_charged_preset,
|
||||||
replaces_id = bat.id
|
replaces_id = bat.id
|
||||||
|
|
Loading…
Reference in New Issue