summaryrefslogtreecommitdiff
path: root/gerrit-widget
diff options
context:
space:
mode:
Diffstat (limited to 'gerrit-widget')
-rw-r--r--gerrit-widget/README.md1
-rw-r--r--gerrit-widget/gerrit.lua3
2 files changed, 3 insertions, 1 deletions
diff --git a/gerrit-widget/README.md b/gerrit-widget/README.md
index d867896..62c89a1 100644
--- a/gerrit-widget/README.md
+++ b/gerrit-widget/README.md
@@ -23,6 +23,7 @@ It is possible to customize widget by providing a table with all or some of the
| `icon`| `/.config/awesome/awesome-wm-widgets/gerrit-widget/gerrit_icon.svg`| Path to the icon |
| `host` | Required | Ex https://gerrit.tmnt.com |
| `query` | `is:reviewer AND status:open AND NOT is:wip` | Query to retrieve reviews |
+| `timeout` | 10 | How often in seconds the widget refreshes |
## Prerequisite
diff --git a/gerrit-widget/gerrit.lua b/gerrit-widget/gerrit.lua
index 69036d0..ad5d7a6 100644
--- a/gerrit-widget/gerrit.lua
+++ b/gerrit-widget/gerrit.lua
@@ -38,6 +38,7 @@ local function worker(args)
text = 'Gerrit host is unknown'
}
local query = args.query or 'is:reviewer AND status:open AND NOT is:wip'
+ local timeout = args.timeout or 10
local current_number_of_reviews
local previous_number_of_reviews = 0
@@ -220,7 +221,7 @@ local function worker(args)
)
)
- watch(string.format(GET_CHANGES_CMD, host, query:gsub(" ", "+")), 10, update_widget, gerrit_widget)
+ watch(string.format(GET_CHANGES_CMD, host, query:gsub(" ", "+")), timeout, update_widget, gerrit_widget)
return gerrit_widget
end