mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-17 14:21:22 +01:00
refactor(komorebic): one komorebic package that builds the CLI of the target OS
The root komorebic package (version 0.1.42) is now the one komorebic: src/main.rs is a cfg_select! over target_os that runs the CLI module of the platform. The Windows main is moved to src/windows.rs (pub fn main); the Linux and macOS CLIs are included from where they live (#[path = "../../komorebi-for-kde/komorebic/src/main.rs"], likewise macOS), so no file moves yet and the old komorebic-linux and komorebic-macos packages still build from the same files. Dependencies are in per-target tables; cargo allows one path per dependency key, so the Linux and macOS crates keep their renamed keys and main.rs aliases them (extern crate komorebi_client_linux as komorebi_client). The unified package needs no reqwest build dependency (committed applications.json) so it builds natively on Linux without openssl. hotkeys.rs: crate::HOME_DIR -> super::HOME_DIR (same crate root in the old package). Gates run: Windows clippy --all-targets -D warnings PASS; KDE check + 294 lib + 5 schemas (old package) PASS; macOS fake-CC check of -p komorebic --target aarch64-apple-darwin --locked --all-targets PASS (type check only); native Linux cargo check/build of -p komorebic PASS and its docgen output is byte-identical to the KDE oracle (166 pages, diff 0); CLI docs oracle byte-identical for windows, macos, kde (S/step4/regen.sh reads komorebic/src/windows.rs now); nix eval of komorebic and the kfde packages OK. Not run: nix builds, e2e (komorebic.exe inputs changed: Windows e2e gate OWED), any macOS link or run (the user must check on a Mac: komorebic --help, --version, start, stop, state, docgen output).
This commit is contained in:
1 parent
80a749b37e
commit
a72b25dc89
7 files changed
+1539
-1471
No files matched your search
Generated
+9
@@ -3829,12 +3829,17 @@ version = "0.1.42"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"clap",
|
||||
"clap_complete",
|
||||
"color-eyre",
|
||||
"dirs 6.0.0",
|
||||
"dunce",
|
||||
"fs-tail",
|
||||
"komorebi-client",
|
||||
"komorebi-client-linux",
|
||||
"komorebi-client-macos",
|
||||
"komorebi-config",
|
||||
"komorebi-hotkeys",
|
||||
"komorebi-linux",
|
||||
"komorebic-core",
|
||||
"lazy_static",
|
||||
"miette",
|
||||
@@ -3845,8 +3850,12 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_json_lenient",
|
||||
"shadow-rs 2.0.0",
|
||||
"sysinfo 0.38.4",
|
||||
"sysinfo 0.39.6",
|
||||
"sysinfo 0.40.0",
|
||||
"thiserror 2.0.21",
|
||||
"version-linux",
|
||||
"version-macos",
|
||||
"which",
|
||||
"win-msgbox",
|
||||
"windows 0.62.2",
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
//! its key binding file again (`ReloadHotkeys`), and `hotkeys release` unregisters every key
|
||||
//! komorebi registered ([`komorebi::kwin::hotkeys::release`]), with or without a daemon.
|
||||
|
||||
use crate::HOME_DIR;
|
||||
use super::HOME_DIR;
|
||||
use clap::Parser;
|
||||
use clap::Subcommand;
|
||||
use clap::ValueEnum;
|
||||
|
||||
@@ -522,7 +522,7 @@ fn send_or_query(messages: Messages) -> eyre::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn main() -> eyre::Result<()> {
|
||||
pub fn main() -> eyre::Result<()> {
|
||||
let opts = komorebic_core::cli::parse::<KdeCommands>(&META);
|
||||
|
||||
match opts.cmd {
|
||||
|
||||
@@ -144,7 +144,7 @@ impl pan::Link for PanLink {
|
||||
}
|
||||
}
|
||||
|
||||
fn main() -> eyre::Result<()> {
|
||||
pub fn main() -> eyre::Result<()> {
|
||||
let opts = komorebic_core::cli::parse::<MacosCommands>(&META);
|
||||
|
||||
match opts.cmd {
|
||||
|
||||
+33
-6
@@ -1,31 +1,37 @@
|
||||
[package]
|
||||
name = "komorebic"
|
||||
version = "0.1.42"
|
||||
description = "The command-line interface for Komorebi, a tiling window manager for Windows"
|
||||
description = "The command-line interface for Komorebi, a tiling window manager for Windows, KDE Plasma and macOS"
|
||||
repository = "https://github.com/LGUG2Z/komorebi"
|
||||
edition = "2024"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
# The dependencies of each platform are in its own table, so that a build for one target compiles
|
||||
# nothing of the others. A dependency key can only have one path, so the Linux and macOS crates
|
||||
# are renamed (`komorebi-client-linux`, ...) and main.rs gives them the names the modules use.
|
||||
|
||||
[dependencies]
|
||||
komorebi-config = { path = "../crates/komorebi-config", default-features = false }
|
||||
komorebi-client = { path = "../komorebi-client", default-features = false }
|
||||
komorebic-core = { path = "../crates/komorebic-core" }
|
||||
|
||||
chrono = { workspace = true }
|
||||
clap = { workspace = true }
|
||||
color-eyre = { workspace = true }
|
||||
dirs = { workspace = true }
|
||||
dunce = { workspace = true }
|
||||
fs-tail = "0.1"
|
||||
lazy_static = { workspace = true }
|
||||
schemars = { workspace = true, optional = true }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
komorebi-client = { path = "../komorebi-client", default-features = false }
|
||||
dunce = { workspace = true }
|
||||
miette = { version = "7", features = ["fancy"] }
|
||||
open = "5"
|
||||
powershell_script = "1.0"
|
||||
reqwest = { version = "0.12", features = ["blocking"] }
|
||||
schemars = { workspace = true, optional = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
shadow-rs = { workspace = true }
|
||||
sysinfo = { workspace = true }
|
||||
thiserror = "2"
|
||||
@@ -33,12 +39,33 @@ which = { workspace = true }
|
||||
win-msgbox = "0.2"
|
||||
windows = { workspace = true }
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
komorebi-client-linux = { package = "komorebi-client-linux", path = "../komorebi-for-kde/komorebi-client", default-features = false }
|
||||
komorebi-linux = { package = "komorebi-linux", path = "../komorebi-for-kde/komorebi", default-features = false }
|
||||
komorebi-hotkeys = { path = "../komorebi-for-kde/komorebi-hotkeys" }
|
||||
version-linux = { package = "version-linux", path = "../komorebi-for-kde/version" }
|
||||
clap_complete = "4"
|
||||
sysinfo = "0.40"
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
komorebi-client-macos = { package = "komorebi-client-macos", path = "../komorebi-for-mac/komorebi-client", default-features = false }
|
||||
version-macos = { package = "version-macos", path = "../komorebi-for-mac/version" }
|
||||
clap_complete = "4"
|
||||
reqwest = { version = "0.12", features = ["blocking"] }
|
||||
sysinfo = "0.38"
|
||||
|
||||
[build-dependencies]
|
||||
shadow-rs = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = ["schemars"]
|
||||
schemars = ["dep:schemars", "komorebi-client/default", "komorebi-config/schemars"]
|
||||
schemars = [
|
||||
"dep:schemars",
|
||||
"komorebi-client/default",
|
||||
"komorebi-client-linux/default",
|
||||
"komorebi-client-macos/default",
|
||||
"komorebi-config/schemars",
|
||||
]
|
||||
|
||||
[lints.rust]
|
||||
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(FALSE)'] }
|
||||
+27
-1462
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user