diff options
Diffstat (limited to 'batteryarc-widget')
-rw-r--r-- | batteryarc-widget/README.md | 2 | ||||
-rw-r--r-- | batteryarc-widget/batteryarc.lua | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/batteryarc-widget/README.md b/batteryarc-widget/README.md index f537534..96e1aeb 100644 --- a/batteryarc-widget/README.md +++ b/batteryarc-widget/README.md @@ -33,7 +33,7 @@ It is possible to customize widget by providing a table with all or some of the | `warning_msg_text` | _Battery is dying_ | Text of the warning popup | | `warning_msg_position` | `bottom_right` | Position of the warning popup | | `warning_msg_icon` | ~/.config/awesome/awesome-wm-widgets/batteryarc-widget/spaceman.jpg | Icon of the warning popup | -| `disable_battery_warning` | `false` | Disable low battery warning | +| `enable_battery_warning` | `true` | Display low battery warning | ## Requirements diff --git a/batteryarc-widget/batteryarc.lua b/batteryarc-widget/batteryarc.lua index 1843cf1..0bf6bc0 100644 --- a/batteryarc-widget/batteryarc.lua +++ b/batteryarc-widget/batteryarc.lua @@ -36,7 +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 disable_battery_warning = args.disable_battery_warning or false + 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", @@ -125,7 +128,7 @@ local function worker(args) if charge < 15 then widget.colors = { low_level_color } - if (not disable_battery_warning) and 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() |