1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-28 15:56:28 +00:00

fix: Disable memory_usage by default (#451)

This commit is contained in:
Matan Kushner 2019-09-30 16:04:49 +09:00 committed by GitHub
parent 7588137b09
commit 9e9eb6a8ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -580,6 +580,13 @@ The `memory_usage` module shows current system memory and swap usage.
By default the swap usage is displayed if the total system swap is non-zero.
::: tip
This module is disabled by default.
To enable it, set `disabled` to `false` in your configuration file.
:::
### Options
| Variable | Default | Description |
@ -589,7 +596,7 @@ By default the swap usage is displayed if the total system swap is non-zero.
| `threshold` | `75` | Hide the memory usage unless it exceeds this percentage. |
| `symbol` | `"🐏 "` | The symbol used before displaying the memory usage. |
| `style` | `"bold dimmed white"` | The style for the module. |
| `disabled` | `false` | Disables the `memory_usage` module. |
| `disabled` | `true` | Disables the `memory_usage` module. |
### Example

View File

@ -12,6 +12,10 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
let mut module = context.new_module("memory_usage");
if module.config_value_bool("disabled").unwrap_or(true) {
return None;
}
let module_style = module
.config_value_style("style")
.unwrap_or_else(|| Color::White.bold().dimmed());

View File

@ -7,7 +7,6 @@ use super::{Context, Module};
pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
let mut module = context.new_module("time");
// Remove when logic for disabled by default exists
if module.config_value_bool("disabled").unwrap_or(true) {
return None;
}