summaryrefslogtreecommitdiff
path: root/brightness-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@users.noreply.github.com>2020-09-21 20:53:22 -0400
committerGitHub <noreply@github.com>2020-09-21 20:53:22 -0400
commit31213af0082bef8344475dbeb84205f1a7e31c7d (patch)
tree2a8b4cad8363c5a0019466edf86d8ef99941d2f4 /brightness-widget
parenta127ffe8efc8ccb91b7a8495c23f67278609df25 (diff)
parent21150bd640f086f617c61b32cde5e45ecfb5158f (diff)
Merge pull request #188 from brucec5/widget-tweaks
Add customizable refresh timeouts to most widgets
Diffstat (limited to 'brightness-widget')
-rw-r--r--brightness-widget/README.md1
-rw-r--r--brightness-widget/brightness.lua3
2 files changed, 3 insertions, 1 deletions
diff --git a/brightness-widget/README.md b/brightness-widget/README.md
index 0db5884..02aa2d3 100644
--- a/brightness-widget/README.md
+++ b/brightness-widget/README.md
@@ -13,6 +13,7 @@ It is possible to customize widget by providing a table with all or some of the
| `dec_brightness_cmd` | `light -U 5`| Decrease brightness |
| `path_to_icon` | `/usr/share/icons/Arc/status/symbolic/display-brightness-symbolic.svg` | Path to the icon |
| `font` | `Play 9` | Font |
+| `timeout` | 1 | How often in seconds the widget refreshes |
### Example:
diff --git a/brightness-widget/brightness.lua b/brightness-widget/brightness.lua
index 28e7015..0cfbea4 100644
--- a/brightness-widget/brightness.lua
+++ b/brightness-widget/brightness.lua
@@ -28,6 +28,7 @@ local function worker(args)
local dec_brightness_cmd = args.dec_brightness_cmd or DEC_BRIGHTNESS_CMD
local path_to_icon = args.path_to_icon or PATH_TO_ICON
local font = args.font or 'Play 9'
+ local timeout = args.timeout or 1
local brightness_text = wibox.widget.textbox()
brightness_text:set_font(font)
@@ -61,7 +62,7 @@ local function worker(args)
end
end)
- watch(get_brightness_cmd, 1, update_widget, brightness_text)
+ watch(get_brightness_cmd, timeout, update_widget, brightness_text)
return widget
end