refactor: Refactor memory_usage module to use module config. (#515)

Also addresses a number of bugs:
- the percent sign not displaying correctly on some terminal emulators, including kitty
- changing the symbol in the configuration file didn't do anything
- swap being shown even if the system didn't have any
This commit is contained in:
Matias Kotlik
2019-10-20 10:26:04 -05:00
committed by Matan Kushner
parent e3f1a76e97
commit 86bb923303
4 changed files with 82 additions and 56 deletions
+1 -1
View File
@@ -691,7 +691,7 @@ To enable it, set `disabled` to `false` in your configuration file.
| Variable | Default | Description |
| ----------------- | ------------------------ | ------------------------------------------------------------- |
| `show_percentage` | `false` | Display memory usage as a percentage of the available memory. |
| `show_swap` | when total swap non-zero | Display swap usage. |
| `show_swap` | `true` | Display swap usage if total 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. |