diff options
author | streetturtle <streetturtle@gmail.com> | 2019-06-02 22:05:37 -0400 |
---|---|---|
committer | streetturtle <streetturtle@gmail.com> | 2019-06-02 22:05:37 -0400 |
commit | 712d11568afe8b9da82920f9e8b08f12c4029736 (patch) | |
tree | 4719c85e7ff264ada6d47c43f052b262b3413e56 /cpu-widget/README.md | |
parent | fb465d371ec9ec93262ec6991c633ffdcd545daf (diff) |
externalize config for cpu widget
Diffstat (limited to 'cpu-widget/README.md')
-rw-r--r-- | cpu-widget/README.md | 40 |
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' + }) ... ``` |