| 1 | # Styling |
| 2 | |
| 3 | Various parts of the bottom can be styled, using either built-in themes or custom theming. |
| 4 | |
| 5 | ## Precedence |
| 6 | |
| 7 | As there are a few ways styles can be applied to bottom, the order of which styles are prioritized are, in order of |
| 8 | highest precedence to lowest precedence: |
| 9 | |
| 10 | 1. Built-in themes set via command-line args (e.g. `btm --theme gruvbox`) |
| 11 | 2. Custom themes set via config file |
| 12 | 3. Built-in themes set via config file |
| 13 | |
| 14 | If nothing is set, it will fall back to the default theme. |
| 15 | |
| 16 | ## Built-in styles |
| 17 | |
| 18 | bottom has a few built-in themes: |
| 19 | |
| 20 | - Default |
| 21 | - [Nord](https://www.nordtheme.com/) |
| 22 | - [Gruvbox](https://github.com/morhetz/gruvbox) |
| 23 | |
| 24 | These themes all also have light variants to support terminals using lighter colours. |
| 25 | |
| 26 | To set the theme from the command line: |
| 27 | |
| 28 | ```bash |
| 29 | btm --theme gruvbox |
| 30 | ``` |
| 31 | |
| 32 | To set the theme using the config file: |
| 33 | |
| 34 | ```toml |
| 35 | [styles] |
| 36 | theme = "gruvbox" |
| 37 | ``` |
| 38 | |
| 39 | ## Custom styling |
| 40 | |
| 41 | bottom's components can also be individually styled by the user to control the colour of the text style. |
| 42 | |
| 43 | ### Colours |
| 44 | |
| 45 | !!! Info |
| 46 | |
| 47 | Note that anywhere `"colour"` is used, it can be substituted for `"color"`: |
| 48 | |
| 49 | ```toml |
| 50 | # This is okay |
| 51 | [styles.widgets.widget_title] |
| 52 | colour = "black" |
| 53 | bg_colour = "white" |
| 54 | |
| 55 | [styles.cpu] |
| 56 | all_entry_colour = "green" |
| 57 | |
| 58 | # This is also okay |
| 59 | [styles.widgets.widget_title] |
| 60 | color = "black" |
| 61 | bg_color = "white" |
| 62 | |
| 63 | [styles.cpu] |
| 64 | all_entry_color = "green" |
| 65 | ``` |
| 66 | |
| 67 | You can configure the colours for components with strings that are either hex colours (e.g. `"#ffffff"`), RGB colours |
| 68 | (e.g. `"255, 255, 255"`), or named colours. Named colours are one of the following strings: |
| 69 | |
| 70 | - `"Black"` |
| 71 | - `"Red"` |
| 72 | - `"Green"` |
| 73 | - `"Yellow"` |
| 74 | - `"Blue"` |
| 75 | - `"Magenta"` |
| 76 | - `"Cyan"` |
| 77 | - `"Gray"` |
| 78 | - `"DarkGray"` |
| 79 | - `"LightRed"` |
| 80 | - `"LightGreen"` |
| 81 | - `"LightYellow"` |
| 82 | - `"LightBlue"` |
| 83 | - `"LightMagenta"` |
| 84 | - `"LightCyan"` |
| 85 | - `"White"` |
| 86 | |
| 87 | ### Text |
| 88 | |
| 89 | Text can generally be styled using the following TOML table: |
| 90 | |
| 91 | ```toml |
| 92 | [field] |
| 93 | # The foreground colour of text. |
| 94 | colour = "black" |
| 95 | |
| 96 | # The background colour of text. |
| 97 | bg_colour = "blue" |
| 98 | |
| 99 | # Whether to make the text bold. |
| 100 | bold = false |
| 101 | |
| 102 | # Inline table version |
| 103 | field = { colour = "black", bg_colour = "blue", bold = false } |
| 104 | ``` |
| 105 | |
| 106 | All fields are optional; by default if `bg_colour` is not set then there will be no background colour. |
| 107 | |
| 108 | If you _just_ want to style text by setting the foreground colour, for brevity, then you can also just set the field |
| 109 | to be the colour itself. For example: |
| 110 | |
| 111 | ```toml |
| 112 | [styles.widgets] |
| 113 | selected_text = "#fff" |
| 114 | ``` |
| 115 | |
| 116 | ### Configuration |
| 117 | |
| 118 | #### CPU |
| 119 | |
| 120 | These can be set under `[styles.cpu]`: |
| 121 | |
| 122 | | Config field | Details | Examples | |
| 123 | | ------------------ | ---------------------------------------------------------------- | --------------------------------------------- | |
| 124 | | `all_entry_colour` | The colour of the "All" CPU label | `all_entry_colour = "Red"` | |
| 125 | | `avg_entry_colour` | The colour of the average CPU label and graph line | `avg_entry_colour = "255, 0, 255"` | |
| 126 | | `cpu_core_colours` | Colour of each CPU threads' label and graph line. Read in order. | `cpu_core_colours = ["Red", "Blue", "Green"]` | |
| 127 | |
| 128 | #### Temperature Graph |
| 129 | |
| 130 | These can be set under `[styles.temp_graph]`: |
| 131 | |
| 132 | | Config field | Details | Examples | |
| 133 | | -------------------------- | -------------------------------------------------------------- | ----------------------------------------------------- | |
| 134 | | `temp_graph_colour_styles` | Colour of each temperature sensor's graph line. Read in order. | `temp_graph_colour_styles = ["Red", "Blue", "Green"]` | |
| 135 | |
| 136 | #### Memory |
| 137 | |
| 138 | These can be set under `[styles.memory]`: |
| 139 | |
| 140 | | Config field | Details | Examples | |
| 141 | | -------------- | ------------------------------------------------------------------------------ | ---------------------------------------- | |
| 142 | | `ram_colour` | The colour of the RAM label and graph line | `ram_colour = "Red"` | |
| 143 | | `cache_colour` | The colour of the cache label and graph line. Does not do anything on Windows. | `cache_colour = "#ffffff"` | |
| 144 | | `swap_colour` | The colour of the swap label and graph line | `swap_colour = "255, 0, 255"` | |
| 145 | | `arc_colour` | The colour of the ARC label and graph line | `arc_colour = "Blue"` | |
| 146 | | `gpu_colours` | Colour of each GPU's memory label and graph line. Read in order. | `gpu_colours = ["Red", "Blue", "Green"]` | |
| 147 | |
| 148 | #### Network |
| 149 | |
| 150 | These can be set under `[styles.network]`: |
| 151 | |
| 152 | | Config field | Details | Examples | |
| 153 | | ----------------- | --------------------------------------------------------- | ----------------------------- | |
| 154 | | `rx_colour` | The colour of the RX (download) label and graph line | `rx_colour = "Red"` | |
| 155 | | `tx_colour` | The colour of the TX (upload) label and graph line | `tx_colour = "#ffffff"` | |
| 156 | | `rx_total_colour` | The colour of the total RX (download) label in basic mode | `rx_total_colour = "0, 0, 0"` | |
| 157 | | `tx_total_colour` | The colour of the total TX (upload) label in basic mode | `tx_total_colour = "#000"` | |
| 158 | |
| 159 | #### Battery |
| 160 | |
| 161 | These can be set under `[styles.battery]`: |
| 162 | |
| 163 | | Config field | Details | Examples | |
| 164 | | ----------------------- | ------------------------------------------------------------------------ | ----------------------------------- | |
| 165 | | `high_battery_colour` | The colour of the battery widget bar when the battery is over 50% | `high_battery_colour = "Red"` | |
| 166 | | `medium_battery_colour` | The colour of the battery widget bar when the battery between 10% to 50% | `medium_battery_colour = "#ffffff"` | |
| 167 | | `low_battery_colour` | The colour of the battery widget bar when the battery is under 10% | `low_battery_colour = "0, 0, 0"` | |
| 168 | |
| 169 | #### Tables |
| 170 | |
| 171 | These can be set under `[styles.tables]`: |
| 172 | |
| 173 | | Config field | Details | Examples | |
| 174 | | ------------ | ------------------------------ | ---------------------------------------------------------------- | |
| 175 | | `headers` | Text styling for table headers | `headers = { colour = "red", bg_colour = "black", bold = true }` | |
| 176 | |
| 177 | #### Graphs |
| 178 | |
| 179 | These can be set under `[styles.graphs]`: |
| 180 | |
| 181 | | Config field | Details | Examples | |
| 182 | | -------------- | -------------------------------------------- | --------------------------------------------------------------------- | |
| 183 | | `graph_colour` | The general colour of the parts of the graph | `graph_colour = "white"` | |
| 184 | | `legend_text` | Text styling for graph's legend text | `legend_text = { colour = "black", bg_colour = "blue", bold = true }` | |
| 185 | |
| 186 | #### General widget settings |
| 187 | |
| 188 | These can be set under `[styles.widgets]`: |
| 189 | |
| 190 | | Config field | Details | Examples | |
| 191 | | ------------------------ | -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | |
| 192 | | `border_colour` | The colour of the widgets' borders | `border_colour = "white"` | |
| 193 | | `selected_border_colour` | The colour of a widget's borders when the widget is selected | `selected_border_colour = "white"` | |
| 194 | | `widget_title` | Text styling for a widget's title | `widget_title = { colour = "black", bg_colour = "blue", bold = true }` | |
| 195 | | `bg_colour` | The background colour of the widgets | `bg_colour = "black"` | |
| 196 | | `text` | Text styling for text in general | `text = { colour = "black", bg_colour = "blue", bold = true }` | |
| 197 | | `selected_text` | Text styling for text when representing something that is selected | `selected_text = { colour = "black", bg_colour = "blue", bold = true }` | |
| 198 | | `disabled_text` | Text styling for text when representing something that is disabled | `disabled_text = { colour = "black", bg_colour = "blue", bold = true }` | |
| 199 | | `thread_text` | Text styling for text when representing process thread, only usable on Linux at the moment | `thread_text = { colour = "green", bg_colour = "blue", bold = true }` | |