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:
parent
7588137b09
commit
9e9eb6a8ef
@ -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
|
||||
|
||||
|
@ -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());
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user