diff options
author | Simeon Simeonov <sgs@pichove.org> | 2020-04-02 13:20:42 +0200 |
---|---|---|
committer | Simeon Simeonov <sgs@pichove.org> | 2020-04-02 13:20:42 +0200 |
commit | 744045db10c7d29e309315f43271c84463bbb846 (patch) | |
tree | 7900acfd8030a9e85b977a1ee8a6ec2c88219eb6 /batteryarc-widget/batteryarc.lua | |
parent | d2bbf765faffdb5628edbae3b169f3f6fcdad356 (diff) |
Make it possible to disable the low battery warning for battery-widget and batteryarc-widget
Diffstat (limited to 'batteryarc-widget/batteryarc.lua')
-rw-r--r-- | batteryarc-widget/batteryarc.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/batteryarc-widget/batteryarc.lua b/batteryarc-widget/batteryarc.lua index d4a67c5..1843cf1 100644 --- a/batteryarc-widget/batteryarc.lua +++ b/batteryarc-widget/batteryarc.lua @@ -36,6 +36,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 local text = wibox.widget { id = "txt", @@ -124,7 +125,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 (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() |