feat(ahk): update cfgen, reintroduce ahk files

This commit updates the config generator used by the ahk-asc command to
emit AHKv2 syntax.

An AHKv2 syntax-compatible komorebic.lib.ahk has been (re)introduced to
the repo root as a file to be distributed. This file is created by
taking the AHKv1 syntax output of ahk-library and automatically
converting it to AHKv2 using the automatic script converter by @mmikeww
available on GitHub.

Given that ahk-library is still being used to emit AHKv1 syntax in this
pipeline, it will remain in the repo.

The justfile has been updated to automate as much of this as possible
(the converter still needs to be run manually).

re #324
This commit is contained in:
LGUG2Z
2023-04-16 14:05:51 -07:00
committed by جاد
parent 27e0758089
commit 60d3ecd8aa
5 changed files with 1127 additions and 183 deletions

View File

@@ -25,30 +25,27 @@ 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)
}
}
}
@@ -56,7 +53,7 @@ impl ApplicationOptions {
#[must_use]
pub fn cfgen(&self, kind: &ApplicationIdentifier, id: &str) -> String {
format!(
"Run, {}, , Hide",
"RunWait(\"{}\", , \"Hide\")",
ApplicationOptions::raw_cfgen(self, kind, id)
)
}
@@ -154,7 +151,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) {
@@ -208,7 +205,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",
"RunWait(\"komorebic.exe float-rule {} '{}'\", , \"Hide\")",
float.kind, float.id
);