diff options
author | Kevin Song <chipbuster@users.noreply.github.com> | 2019-09-07 19:33:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-07 19:33:06 -0500 |
commit | 9721666d331ddfd7a04bbb434cccf38b44701b00 (patch) | |
tree | 8edb32e1cebc6951451953a311cd9cfb4447712d /src/modules/battery.rs | |
parent | 3e5cac98522feca856867e32cf3df52ff0285c62 (diff) |
feat: Add the ability to configure per-module color styles (#285)
Add parsing logic, config support, docs, and integration with other modules
for custom styling of each module.
Diffstat (limited to 'src/modules/battery.rs')
-rw-r--r-- | src/modules/battery.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/battery.rs b/src/modules/battery.rs index 800fb6d23..47c9eee73 100644 --- a/src/modules/battery.rs +++ b/src/modules/battery.rs @@ -30,7 +30,10 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> { // TODO: Set style based on percentage when threshold is modifiable let mut module = context.new_module("battery")?; - module.set_style(Color::Red.bold()); + let module_style = module + .config_value_style("style") + .unwrap_or_else(|| Color::Red.bold()); + module.set_style(module_style); module.get_prefix().set_value(""); match state { |