summaryrefslogtreecommitdiff
path: root/battery-widget
diff options
context:
space:
mode:
Diffstat (limited to 'battery-widget')
-rw-r--r--battery-widget/README.md1
-rw-r--r--battery-widget/battery.lua3
2 files changed, 3 insertions, 1 deletions
diff --git a/battery-widget/README.md b/battery-widget/README.md
index 4ea14d8..9af7a4c 100644
--- a/battery-widget/README.md
+++ b/battery-widget/README.md
@@ -28,6 +28,7 @@ It is possible to customize widget by providing a table with all or some of the
| `margin_left`|0| The left margin of the widget|
| `display_notification` | `false` | Display a notification on mouseover |
| `notification_position` | `top_right` | The notification position |
+| `timeout` | 10 | How often in seconds the widget refreshes |
| `warning_msg_title` | _Huston, we have a problem_ | Title of the warning popup |
| `warning_msg_text` | _Battery is dying_ | Text of the warning popup |
| `warning_msg_position` | `bottom_right` | Position of the warning popup |
diff --git a/battery-widget/battery.lua b/battery-widget/battery.lua
index 919fb60..9fa50ed 100644
--- a/battery-widget/battery.lua
+++ b/battery-widget/battery.lua
@@ -33,6 +33,7 @@ local function worker(args)
local display_notification = args.display_notification or false
local position = args.notification_position or "top_right"
+ local timeout = args.timeout or 10
local warning_msg_title = args.warning_msg_title or 'Huston, we have a problem'
local warning_msg_text = args.warning_msg_text or 'Battery is dying'
@@ -116,7 +117,7 @@ local function worker(args)
local last_battery_check = os.time()
local batteryType = "battery-good-symbolic"
- watch("acpi -i", 10,
+ watch("acpi -i", timeout,
function(widget, stdout, stderr, exitreason, exitcode)
local battery_info = {}
local capacities = {}