summaryrefslogtreecommitdiff
path: root/battery-widget/battery.lua
diff options
context:
space:
mode:
authorSimeon Simeonov <sgs@pichove.org>2020-04-05 11:23:37 +0200
committerSimeon Simeonov <sgs@pichove.org>2020-04-05 11:24:04 +0200
commit60ddaf329bae52f6bb9c82071c40c3d9e08add4f (patch)
tree130085948afee78359a8dcdc8db8ec34aeaf8751 /battery-widget/battery.lua
parent3ecea9dcc23906d6804849f0eb80bc6d840b1776 (diff)
Make it possible to disable the low battery warning
Diffstat (limited to 'battery-widget/battery.lua')
-rw-r--r--battery-widget/battery.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/battery-widget/battery.lua b/battery-widget/battery.lua
index c066fcc..d84e591 100644
--- a/battery-widget/battery.lua
+++ b/battery-widget/battery.lua
@@ -38,6 +38,10 @@ local function worker(args)
local warning_msg_text = args.warning_msg_text or 'Battery is dying'
local warning_msg_position = args.warning_msg_position or 'bottom_right'
local warning_msg_icon = args.warning_msg_icon or HOME .. '/.config/awesome/awesome-wm-widgets/batteryarc-widget/spaceman.jpg'
+ local enable_battery_warning = args.enable_battery_warning
+ if enable_battery_warning == nil then
+ enable_battery_warning = true
+ end
if not gfs.dir_readable(path_to_icons) then
naughty.notify{
@@ -147,7 +151,7 @@ local function worker(args)
if (charge >= 0 and charge < 15) then
batteryType = "battery-empty%s-symbolic"
- if status ~= 'Charging' and os.difftime(os.time(), last_battery_check) > 300 then
+ if enable_battery_warning and status ~= 'Charging' and os.difftime(os.time(), last_battery_check) > 300 then
-- if 5 minutes have elapsed since the last warning
last_battery_check = os.time()