summaryrefslogtreecommitdiff
path: root/batteryarc-widget/batteryarc.lua
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2020-04-13 08:46:12 -0400
committerstreetturtle <streetturtle@gmail.com>2020-04-13 08:46:12 -0400
commitcf1e36d4d53035f70d762c0b8fab75bedcb42ca5 (patch)
treefa506fb8e71f48b881eee8e124b00d3030ea4de7 /batteryarc-widget/batteryarc.lua
parentedb5283c6d644a182d9d2c789b14bdeb372c4928 (diff)
parent5d8de54de6546ab882b85f42cee9106433b5b02c (diff)
Merge branch 'master' of github.com:streetturtle/awesome-wm-widgets
Diffstat (limited to 'batteryarc-widget/batteryarc.lua')
-rw-r--r--batteryarc-widget/batteryarc.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/batteryarc-widget/batteryarc.lua b/batteryarc-widget/batteryarc.lua
index d4a67c5..0bf6bc0 100644
--- a/batteryarc-widget/batteryarc.lua
+++ b/batteryarc-widget/batteryarc.lua
@@ -36,6 +36,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
local text = wibox.widget {
id = "txt",
@@ -124,7 +128,7 @@ local function worker(args)
if charge < 15 then
widget.colors = { low_level_color }
- 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()