summaryrefslogtreecommitdiff
path: root/cpu-widget/README.md
diff options
context:
space:
mode:
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'
+ })
...
```