mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-18 06:38:38 +01:00
This commit is largely lift and shift of LGUG2Z/komorebi@c165172: The implementation adds a new layout-ratio CLI command to komorebi that allows users to dynamically set column and row ratios for layouts at runtime via komorebic layout-ratio --columns 0.3 0.4 --rows 0.5. A public validate_ratios function was added to komorebi-layouts that clamps ratio values between 0.1 and 0.9, truncates when the cumulative sum would reach or exceed 1.0, and limits to a maximum of 5 ratios. This function is shared between config file deserialization and the new CLI command, ensuring consistent validation behavior. The SocketMessage enum in komorebi/src/core/mod.rs has a new LayoutRatios variant. The handler in process_command.rs uses the shared validate_ratios function to process the ratios before applying them to the focused workspace's layout options. When the CLI command is called without any arguments, it prints a helpful message instead of returning an error.
49 lines
1.1 KiB
TOML
49 lines
1.1 KiB
TOML
[workspace]
|
|
|
|
resolver = "2"
|
|
members = [
|
|
"komorebi",
|
|
"komorebi-bar",
|
|
"komorebi-client",
|
|
"komorebic",
|
|
"version",
|
|
]
|
|
|
|
[workspace.package]
|
|
version = "0.1.0"
|
|
|
|
[workspace.dependencies]
|
|
komorebi-themes = { git = "https://github.com/LGUG2Z/komorebi", rev = "98122bd9d4aabbff927a29228acf6c8a0246c509" }
|
|
komorebi-layouts = { git = "https://github.com/LGUG2Z/komorebi", rev = "c165172b5a636f383739a99dc51a35fe4a3a77ef", features = [
|
|
"darwin",
|
|
"schemars",
|
|
] }
|
|
|
|
chrono = "0.4"
|
|
chrono-tz = "0.10"
|
|
clap = { version = "4", features = ["derive", "wrap_help"] }
|
|
color-eyre = "0.6"
|
|
crossbeam-channel = "0.5"
|
|
crossbeam-utils = "0.8"
|
|
dirs = "6"
|
|
dunce = "1"
|
|
eframe = "0.33"
|
|
egui_extras = "0.33"
|
|
hotwatch = "0.5"
|
|
lazy_static = "1"
|
|
parking_lot = "0.12"
|
|
pastey = "0.2"
|
|
schemars = "1.1"
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = { package = "serde_json_lenient", version = "0.2" }
|
|
shadow-rs = "1"
|
|
sysinfo = "0.37"
|
|
thiserror = "2"
|
|
tracing = "0.1"
|
|
tracing-appender = "0.2"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
which = "8"
|
|
|
|
[workspace.metadata.crane]
|
|
name = "komorebi-workspace"
|