Skip to content

Commit

Permalink
fix(ahk): implement syntax corrections by @sitiom
Browse files Browse the repository at this point in the history
  • Loading branch information
LGUG2Z committed Apr 30, 2023
1 parent 60d3ecd commit e044a5a
Show file tree
Hide file tree
Showing 6 changed files with 359 additions and 360 deletions.
5 changes: 1 addition & 4 deletions justfile
Expand Up @@ -26,10 +26,7 @@ install:
komorebic pwsh-asc '~/komorebi-application-specific-configuration/applications.yaml'
cat '~/.config/komorebi/komorebi.generated.ps1' >komorebi.generated.ps1
cat '~/.config/komorebi/komorebi.generated.ahk' >komorebi.generated.ahk
echo '#Requires AutoHotkey v2.0.2' >komorebic.lib.ahk
echo '#SingleInstance Force' >>komorebic.lib.ahk
echo '' >>komorebic.lib.ahk
cat '~/.config/komorebi/komorebic.lib_newV2.ahk' >>komorebic.lib.ahk
cat '~/.config/komorebi/komorebic.lib_newV2.ahk' >komorebic.lib.ahk

run:
just install-komorebic
Expand Down
19 changes: 11 additions & 8 deletions komorebi-core/src/config_generation.rs
Expand Up @@ -25,35 +25,38 @@ 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 {} '{}'",
"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)
}
}
}

#[must_use]
pub fn cfgen(&self, kind: &ApplicationIdentifier, id: &str) -> String {
format!(
"RunWait(\"{}\", , \"Hide\")",
"RunWait('{}', , \"Hide\")",
ApplicationOptions::raw_cfgen(self, kind, id)
)
}
Expand Down Expand Up @@ -151,7 +154,7 @@ impl ApplicationConfigurationGenerator {
if let Some(float_identifiers) = app.float_identifiers {
for float in float_identifiers {
let float_rule =
format!("komorebic.exe float-rule {} '{}'", float.kind, float.id);
format!("komorebic.exe float-rule {} \"{}\"", float.kind, float.id);

// Don't want to send duped signals especially as configs get larger
if !float_rules.contains(&float_rule) {
Expand Down Expand Up @@ -205,7 +208,7 @@ impl ApplicationConfigurationGenerator {
if let Some(float_identifiers) = app.float_identifiers {
for float in float_identifiers {
let float_rule = format!(
"RunWait(\"komorebic.exe float-rule {} '{}'\", , \"Hide\")",
"RunWait('komorebic.exe float-rule {} \"{}\"', , \"Hide\")",
float.kind, float.id
);

Expand Down

0 comments on commit e044a5a

Please sign in to comment.