summaryrefslogtreecommitdiff
path: root/battery-widget/battery.lua
diff options
context:
space:
mode:
authorSimeon Simeonov <sgs@pichove.org>2020-04-02 13:20:42 +0200
committerSimeon Simeonov <sgs@pichove.org>2020-04-02 13:20:42 +0200
commit744045db10c7d29e309315f43271c84463bbb846 (patch)
tree7900acfd8030a9e85b977a1ee8a6ec2c88219eb6 /battery-widget/battery.lua
parentd2bbf765faffdb5628edbae3b169f3f6fcdad356 (diff)
Make it possible to disable the low battery warning for battery-widget and batteryarc-widget
Diffstat (limited to 'battery-widget/battery.lua')
-rw-r--r--battery-widget/battery.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/battery-widget/battery.lua b/battery-widget/battery.lua
index b47794d..43cdaee 100644
--- a/battery-widget/battery.lua
+++ b/battery-widget/battery.lua
@@ -38,6 +38,7 @@ 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 disable_battery_warning = args.disable_battery_warning or false
if not gfs.dir_readable(path_to_icons) then
naughty.notify{
@@ -149,7 +150,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 (not disable_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()