summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authort-mangoe <m.takashi.xpair@gmail.com>2021-04-17 20:52:46 +0900
committerGitHub <noreply@github.com>2021-04-17 13:52:46 +0200
commit1ee59ed18cb5ba6e130bdc28c79c2341e7297356 (patch)
tree92c410de1e78d15effa6bd9a00d1be9d11469009 /docs
parente0f181d2c70d7fc22c5401a6b6f2b0191b1ae800 (diff)
feat(battery): Add a symbol option to `battery.display` (#2475)
* feat: Add a symbol option to `battery.display` * feat: Add a symbol option to `battery.display` * use `impl defaulat` instead of `RootModuleConfig` * edit the code according to clippy's linting * change variable type to `Option<'a str>` * update the documentation on the battery module * updated documentation and source code according to review comment * remove the unnecessary method and write the default value of BatteryDisplayConig to the document * add 'charging_symbol' option to battery.display
Diffstat (limited to 'docs')
-rw-r--r--docs/config/README.md19
1 files changed, 12 insertions, 7 deletions
diff --git a/docs/config/README.md b/docs/config/README.md
index 7b75b3018..675906e60 100644
--- a/docs/config/README.md
+++ b/docs/config/README.md
@@ -348,7 +348,7 @@ discharging_symbol = "💀 "
### Battery Display
-The `display` configuration option is used to define when the battery indicator should be shown (threshold) and what it looks like (style).
+The `display` configuration option is used to define when the battery indicator should be shown (threshold), which symbol would be used (symbol), and what it would like (style).
If no `display` is provided. The default is as shown:
```toml
@@ -357,25 +357,30 @@ threshold = 10
style = "bold red"
```
+The default value for the `charging_symbol` and `discharging_symbol` option is respectively the value of `battery`'s `charging_symbol` and `discharging_symbol` option.
+
#### Options
The `display` option is an array of the following table.
-| Option | Description |
-| ----------- | ----------------------------------------------- |
-| `threshold` | The upper bound for the display option. |
-| `style` | The style used if the display option is in use. |
+| Option | Default | Description |
+| -------------------- | ---------- | ----------------------------------------------- |
+| `threshold` | `10` | The upper bound for the display option. |
+| `style` | `bold red` | The style used if the display option is in use. |
+| `charging_symbol` | `-` | Optional symbol displayed if display option is in use, defaults to battery's `charging_symbol` option. |
+| `discharging_symbol` | `-` | Optional symbol displayed if display option is in use, defaults to battery's `discharging_symbol` option. |
#### Example
```toml
-[[battery.display]] # "bold red" style when capacity is between 0% and 10%
+[[battery.display]] # "bold red" style and discharging_symbol when capacity is between 0% and 10%
threshold = 10
style = "bold red"
-[[battery.display]] # "bold yellow" style when capacity is between 10% and 30%
+[[battery.display]] # "bold yellow" style and 💦 symbol when capacity is between 10% and 30%
threshold = 30
style = "bold yellow"
+discharging_symbol = 💦
# when capacity is over 30%, the battery indicator will not be displayed