|
|
@ -37,7 +37,7 @@ impl BarModuleFn for BarModuleWindow { |
|
|
|
|
|
|
|
|
|
|
|
fn default_config(instance: String) -> config::ModuleConfig { |
|
|
|
fn default_config(instance: String) -> config::ModuleConfig { |
|
|
|
config::ModuleConfig { |
|
|
|
config::ModuleConfig { |
|
|
|
name: Self::name().to_owned(), |
|
|
|
name: NAME.to_owned(), |
|
|
|
instance, |
|
|
|
instance, |
|
|
|
format: "🪟 {title} — {app_name}".to_owned(), |
|
|
|
format: "🪟 {title} — {app_name}".to_owned(), |
|
|
|
html_escape: true, |
|
|
|
html_escape: true, |
|
|
@ -45,10 +45,6 @@ impl BarModuleFn for BarModuleWindow { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fn name() -> &'static str { |
|
|
|
|
|
|
|
NAME |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn get_config(&self) -> &config::ModuleConfig { |
|
|
|
fn get_config(&self) -> &config::ModuleConfig { |
|
|
|
&self.config |
|
|
|
&self.config |
|
|
|
} |
|
|
|
} |
|
|
@ -61,14 +57,14 @@ impl BarModuleFn for BarModuleWindow { |
|
|
|
let text = match focused_win { |
|
|
|
let text = match focused_win { |
|
|
|
Some(win) => { |
|
|
|
Some(win) => { |
|
|
|
fmt_replace!(&self.config.format, self.config.html_escape, { |
|
|
|
fmt_replace!(&self.config.format, self.config.html_escape, { |
|
|
|
"title" |"name" => win.get_name(), |
|
|
|
"title" | "name" => win.get_name(), |
|
|
|
"app_name" => win.get_app_name(), |
|
|
|
"app_name" => win.get_app_name(), |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
None => String::new(), |
|
|
|
None => String::new(), |
|
|
|
}; |
|
|
|
}; |
|
|
|
s::Block { |
|
|
|
s::Block { |
|
|
|
name: Some(Self::name().to_owned()), |
|
|
|
name: Some(NAME.to_owned()), |
|
|
|
instance: Some(self.config.instance.clone()), |
|
|
|
instance: Some(self.config.instance.clone()), |
|
|
|
full_text: text, |
|
|
|
full_text: text, |
|
|
|
align: Some(s::Align::Left), |
|
|
|
align: Some(s::Align::Left), |
|
|
|