diff --git a/komorebi-core/src/config_generation.rs b/komorebi-core/src/config_generation.rs index 2fd97dc3..e7cec879 100644 --- a/komorebi-core/src/config_generation.rs +++ b/komorebi-core/src/config_generation.rs @@ -27,24 +27,30 @@ impl ApplicationOptions { match self { ApplicationOptions::ObjectNameChange => { format!( - "komorebic.exe identify-object-name-change-application {} {}", + "komorebic.exe identify-object-name-change-application {} \"{}\"", kind, id ) } ApplicationOptions::Layered => { - format!("komorebic.exe identify-layered-application {} {}", kind, id) + format!( + "komorebic.exe identify-layered-application {} \"{}\"", + kind, id + ) } ApplicationOptions::BorderOverflow => { format!( - "komorebic.exe identify-border-overflow-application {} {}", + "komorebic.exe identify-border-overflow-application {} \"{}\"", kind, id ) } ApplicationOptions::TrayAndMultiWindow => { - format!("komorebic.exe identify-tray-application {} {}", kind, id) + format!( + "komorebic.exe identify-tray-application {} \"{}\"", + kind, id + ) } ApplicationOptions::Force => { - format!("komorebic.exe manage-rule {} {}", kind, id) + format!("komorebic.exe manage-rule {} \"{}\"", kind, id) } } ) @@ -145,7 +151,7 @@ impl ApplicationConfigurationGenerator { if let Some(float_identifiers) = app.float_identifiers { for float in float_identifiers { let float_rule = format!( - "Run, komorebic.exe float-rule {} {}, , Hide", + "Run, komorebic.exe float-rule {} \"{}\", , Hide", float.kind, float.id ); diff --git a/komorebic.lib.sample.ahk b/komorebic.lib.sample.ahk index 8b498bbd..d62d43f0 100644 --- a/komorebic.lib.sample.ahk +++ b/komorebic.lib.sample.ahk @@ -257,31 +257,31 @@ WindowHidingBehaviour(hiding_behaviour) { } FloatRule(identifier, id) { - Run, komorebic.exe float-rule %identifier% %id%, , Hide + Run, komorebic.exe float-rule %identifier% "%id%", , Hide } ManageRule(identifier, id) { - Run, komorebic.exe manage-rule %identifier% %id%, , Hide + Run, komorebic.exe manage-rule %identifier% "%id%", , Hide } WorkspaceRule(identifier, id, monitor, workspace) { - Run, komorebic.exe workspace-rule %identifier% %id% %monitor% %workspace%, , Hide + Run, komorebic.exe workspace-rule %identifier% "%id%" %monitor% %workspace%, , Hide } IdentifyObjectNameChangeApplication(identifier, id) { - Run, komorebic.exe identify-object-name-change-application %identifier% %id%, , Hide + Run, komorebic.exe identify-object-name-change-application %identifier% "%id%", , Hide } IdentifyTrayApplication(identifier, id) { - Run, komorebic.exe identify-tray-application %identifier% %id%, , Hide + Run, komorebic.exe identify-tray-application %identifier% "%id%", , Hide } IdentifyLayeredApplication(identifier, id) { - Run, komorebic.exe identify-layered-application %identifier% %id%, , Hide + Run, komorebic.exe identify-layered-application %identifier% "%id%", , Hide } IdentifyBorderOverflowApplication(identifier, id) { - Run, komorebic.exe identify-border-overflow-application %identifier% %id%, , Hide + Run, komorebic.exe identify-border-overflow-application %identifier% "%id%", , Hide } FocusFollowsMouse(boolean_state, implementation) { diff --git a/komorebic/src/main.rs b/komorebic/src/main.rs index 5361626c..a0ec0ef8 100644 --- a/komorebic/src/main.rs +++ b/komorebic/src/main.rs @@ -692,7 +692,10 @@ fn main() -> Result<()> { .truncate(true) .open(library.clone())?; - file.write_all(SubCommand::generate_ahk_library().as_bytes())?; + let output: String = SubCommand::generate_ahk_library(); + let fixed_output = output.replace("%id%", "\"%id%\""); + + file.write_all(fixed_output.as_bytes())?; println!( "\nAHK helper library for komorebic written to {}",