| 1 | # Layout |
| 2 | |
| 3 | !!! Warning |
| 4 | |
| 5 | This section is in progress, and is just copied from the old documentation. |
| 6 | |
| 7 | bottom supports customizable layouts via the config file. Currently, layouts are controlled by using TOML objects and arrays. |
| 8 | |
| 9 | For example, given the sample layout: |
| 10 | |
| 11 | ```toml |
| 12 | [[row]] |
| 13 | [[row.child]] |
| 14 | type="cpu" |
| 15 | [[row]] |
| 16 | ratio=2 |
| 17 | [[row.child]] |
| 18 | ratio=4 |
| 19 | type="mem" |
| 20 | [[row.child]] |
| 21 | ratio=3 |
| 22 | [[row.child.child]] |
| 23 | type="temp" |
| 24 | [[row.child.child]] |
| 25 | type="disk" |
| 26 | ``` |
| 27 | |
| 28 | This would give a layout that has two rows, with a 1:2 ratio. The first row has only the CPU widget. |
| 29 | The second row is split into two columns with a 4:3 ratio. The first column contains the memory widget. |
| 30 | The second column is split into two rows with a 1:1 ratio. The first is the temperature widget, the second is the disk widget. |
| 31 | |
| 32 | This is what the layout would look like when run: |
| 33 | |
| 34 |  |
| 35 | |
| 36 | Each `[[row]]` represents a _row_ in the layout. A row can have any number of `child` values. Each `[[row.child]]` |
| 37 | represents either a _column or a widget_. A column can have any number of `child` values as well. Each `[[row.child.child]]` |
| 38 | represents a _widget_. A widget is represented by having a `type` field set to a string. |
| 39 | |
| 40 | The following `type` values are supported: |
| 41 | |
| 42 | | | | |
| 43 | | ----------------------------------- | ------------------------ | |
| 44 | | `"cpu"` | CPU chart and legend | |
| 45 | | `"mem", "memory"` | Memory chart | |
| 46 | | `"net", "network"` | Network chart and legend | |
| 47 | | `"proc", "process", "processes"` | Process table and search | |
| 48 | | `"temp", "temperature"` | Temperature table | |
| 49 | | `"temp_graph", "temperature_graph"` | Temperature graph | |
| 50 | | `"disk"` | Disk table | |
| 51 | | `"empty"` | An empty space | |
| 52 | | `"batt", "battery"` | Battery statistics | |
| 53 | |
| 54 | Each component of the layout accepts a `ratio` value. If this is not set, it defaults to 1. |
| 55 | |
| 56 | Furthermore, you can have duplicate widgets. |
| 57 | |
| 58 | For an example, look at the [default config](https://github.com/ClementTsang/bottom/blob/main/sample_configs/default_config.toml), which contains the default layout. |