diff --git a/src/configuration.rs b/src/configuration.rs index 12ff3fa..8185e09 100644 --- a/src/configuration.rs +++ b/src/configuration.rs @@ -9,6 +9,7 @@ pub type Configuration = Vec; pub struct Entry { pub exe: String, pub target_layer: String, + pub strategy: Option, pub title_overrides: Option>, pub virtual_key_overrides: Option>, pub virtual_key_ignores: Option>, diff --git a/src/events.rs b/src/events.rs index 8054a4d..9660e8b 100644 --- a/src/events.rs +++ b/src/events.rs @@ -51,7 +51,8 @@ fn calculate_target( let configuration = CONFIG.get().unwrap(); let mut new_layer = default; for entry in configuration { - if entry.exe == exe { + let entry_strategy = entry.strategy.clone().unwrap_or(Strategy::Equals); + if matches_with_strategy(exe, &entry.exe, &entry_strategy) { if matches!(event, Event::FocusChange) { new_layer = Option::from(entry.target_layer.as_str()); }