summaryrefslogtreecommitdiff
path: root/cpu-widget/README.md
diff options
context:
space:
mode:
authorPavel Makhov <pmakhov@theoctavegroup.com>2019-09-17 15:29:36 -0400
committerPavel Makhov <pmakhov@theoctavegroup.com>2019-09-17 15:29:36 -0400
commit6fd76c254b296da86619b43db619ccebcd521853 (patch)
treea005c8045bbee2998642c55fd5edadb258ea87de /cpu-widget/README.md
parent372ae3c9e7cab4b64b8dcaf31d9d2d921a723585 (diff)
parent2e211937a116102c3647b85070718102192ddc54 (diff)
Merge branch '74-externalize-config'
Note: breaking change, now widgets should be created with parentheses, i.e. battery(), instead of battery. Read more in README of the widget.
Diffstat (limited to 'cpu-widget/README.md')
-rw-r--r--cpu-widget/README.md40
1 files changed, 36 insertions, 4 deletions
diff --git a/cpu-widget/README.md b/cpu-widget/README.md
index 500e1b9..31fb0d6 100644
--- a/cpu-widget/README.md
+++ b/cpu-widget/README.md
@@ -2,9 +2,7 @@
This widget shows the average CPU load among all cores of the machine:
-![screenshot](out.gif)
-
-When the load is more than 80% the graph becomes red. You can easily customize the widget by changing colors, step width, step spacing, width and interval.
+![screenshot](cpu.gif)
## How it works
@@ -18,6 +16,32 @@ cpu 197294 718 50102 2002182 3844 0 2724 0 0 0
and calculates the percentage.
+## Customization
+
+It is possible to customize widget by providing a table with all or some of the following config parameters:
+
+| Name | Default | Description |
+|---|---|---|
+| `width` | 50 | Width of the widget |
+| `step_width` | 2 | Width of the step |
+| `step_spacing` | 1 | Space size between steps |
+| `color` | `beautiful.fg_normal` | Color of the graph |
+
+### Example
+
+```lua
+cpu_widget({
+ width = 70,
+ step_width = 2,
+ step_spacing = 0,
+ color = '#434c5e'
+})
+```
+
+The config above results in the following widget:
+
+![custom](./custom.png)
+
## Installation
Clone/download repo and use widget in **rc.lua**:
@@ -29,6 +53,14 @@ s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
- cpu_widget,
+ -- default
+ cpu_widget(),
+ -- or custom
+ cpu_widget({
+ width = 70,
+ step_width = 2,
+ step_spacing = 0,
+ color = '#434c5e'
+ })
...
```