summaryrefslogtreecommitdiffstats
path: root/src/configs/username.rs
diff options
context:
space:
mode:
authorZhenhui Xie <xiezh0831@yahoo.co.jp>2019-10-19 09:51:38 +0800
committerMatan Kushner <hello@matchai.me>2019-10-19 10:51:38 +0900
commitaadd8ecf2c0f3bdbb9684f900fee66b13f47c061 (patch)
treed2ff151e7bdc0de6c9b89e4723a3df23025aa957 /src/configs/username.rs
parent09353fff005b2b983fe9917df662483b9669dd64 (diff)
refactor: Refactor modules to use module config (#514)
Diffstat (limited to 'src/configs/username.rs')
-rw-r--r--src/configs/username.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/configs/username.rs b/src/configs/username.rs
new file mode 100644
index 000000000..8414fe68c
--- /dev/null
+++ b/src/configs/username.rs
@@ -0,0 +1,23 @@
+use crate::config::{ModuleConfig, RootModuleConfig};
+
+use ansi_term::{Color, Style};
+use starship_module_config_derive::ModuleConfig;
+
+#[derive(Clone, ModuleConfig)]
+pub struct UsernameConfig {
+ pub style_root: Style,
+ pub style_user: Style,
+ pub show_always: bool,
+ pub disabled: bool,
+}
+
+impl<'a> RootModuleConfig<'a> for UsernameConfig {
+ fn new() -> Self {
+ UsernameConfig {
+ style_root: Color::Red.bold(),
+ style_user: Color::Yellow.bold(),
+ show_always: false,
+ disabled: false,
+ }
+ }
+}