refactor(daemon): one komorebi package and binary, the daemon of each platform is a library

Step 8 (Option A of docs/dev/unified-binaries.md). The main.rs of komorebi-windows, komorebi-linux and
komorebi-macos becomes daemon.rs of the library (pub fn run; komorebi:: paths are crate:: paths now, the
inner attributes and the unit tests move with it), and their [[bin]] is gone, so each is a library only.
The new package komorebi (komorebi-daemon/, version 0.1.42) is the one binary: its main calls
komorebi_windows::daemon::run, komorebi_linux::daemon::run or komorebi_macos::daemon::run by cfg_select! on
the target OS, through target-gated dependencies (one key per library, cargo allows one path per key),
and forwards the features deadlock_detection and schemars. The binary name komorebi now comes from exactly
one package. The four KDE integration tests that run the binary (no_kwin, socket, hot_reload, version)
move to komorebi-daemon/tests/linux_*.rs; the version test compares with the KDE version crate, since
the package version is now shared. Old names: komorebi-windows, komorebi-linux and komorebi-macos still
build, as libraries (no binary any more: use -p komorebi). The flakes build -p komorebi with the KDE and
macOS packages, the source filters take komorebi-daemon (manifest, main.rs, linux tests), the Windows
filter leaves its linux tests out, deny.toml clarify entries gain komorebi, the release workflow's cargo wix
and the justfile version lookup name komorebi, tools/fast-check checks -p komorebi on KDE and macOS.
Behaviour: the same code runs, the same binary name; the Windows executable is rebuilt from the library
(BEHAVIOUR for the e2e gate: the Windows e2e must run).

Gates run: Windows clippy --all-targets -D warnings PASS; KDE check; macOS fake-CC check of -p komorebi
-p komorebi-macos PASS (type check only); KDE cargo test -p komorebi -p komorebi-linux -p komorebic -p
komorebi-client -p komorebi-hotkeys -p komorebi-core: 903 passed, 0 failed (the four moved tests and the
unit test of daemon.rs included); CLI docs oracle identical x3; bar schema harness identical both bars;
kde-closure-check ok; nix evaluation of the root and both nested flakes PASS; by evaluation an edit of
komorebi/src/daemon.rs changes the Windows derivations only, of the KDE daemon.rs kfde only, of the macOS
one neither (the shared komorebi-daemon/src/main.rs changes all, as expected). Not run: nix builds, VM,
e2e, any Mac run.
This commit is contained in:
LGUG2Z committed 2026-11-05 10:30:05 -08:00
1 parent e663e346ba
commit 7330c8e8ec
26 files changed
+212 -116

No files matched your search

+1 -1
View File
@@ -68,7 +68,7 @@ jobs:
args: "--locked --release"
- run: |
cargo install cargo-wix
cargo wix --no-build -p komorebi-windows --nocapture -I .\wix\main.wxs --target ${{ matrix.platform.target }}
cargo wix --no-build -p komorebi --nocapture -I .\wix\main.wxs --target ${{ matrix.platform.target }}
- uses: actions/upload-artifact@v7
with:
name: komorebi-${{ matrix.platform.target }}-${{ github.sha }}
Generated
+11
View File
@@ -3383,6 +3383,17 @@ version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
[[package]]
name = "komorebi"
version = "0.1.42"
dependencies = [
"color-eyre",
"komorebi-linux",
"komorebi-macos",
"komorebi-windows",
"serde_json_lenient",
]
[[package]]
name = "komorebi-backend"
version = "0.1.42"
+2
View File
@@ -13,6 +13,7 @@ members = [
"komorebi-layouts",
"komorebi-scrolling",
"komorebic",
"komorebi-daemon",
"komorebic-no-console",
"crates/komorebic-core",
"komorebi-bar",
@@ -48,6 +49,7 @@ default-members = [
"komorebi-layouts",
"komorebi-scrolling",
"komorebic",
"komorebi-daemon",
"komorebic-no-console",
"crates/komorebic-core",
"komorebi-bar",
+5
View File
@@ -42,6 +42,11 @@ allow = [
]
confidence-threshold = 0.8
[[licenses.clarify]]
crate = "komorebi"
expression = "LicenseRef-Komorebi-2.0"
license-files = []
[[licenses.clarify]]
crate = "komorebi-windows"
expression = "LicenseRef-Komorebi-2.0"
+1 -1
View File
@@ -224,7 +224,7 @@
# the other platforms' crates are added as stubs below
!(pkgs.lib.hasInfix "/komorebi-for-kde" path || pkgs.lib.hasInfix "/komorebi-for-mac" path)
# the Linux and macOS files of komorebic are not read when building for Windows
&& !(builtins.match ".*/komorebi(c/(src/(linux|macos)|tests/(linux|macos)_)|-client/(src/(linux|macos)\\.rs|tests/(linux|macos)_)|-bar/src/macos)[^/]*.*" path != null)
&& !(builtins.match ".*/komorebi(c/(src/(linux|macos)|tests/(linux|macos)_)|-client/(src/(linux|macos)\\.rs|tests/(linux|macos)_)|-bar/src/macos|-daemon/tests/(linux|macos)_)[^/]*.*" path != null)
&& (
(craneLib.filterCargoSources path type)
|| (pkgs.lib.hasInfix "/docs/" path)
+1 -1
View File
@@ -86,7 +86,7 @@ jsonschema:
cargo run --package komorebic -- application-specific-configuration-schema > schema.asc.json
cargo run --package komorebi-bar -- --schema > schema.bar.json
version := `cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.name == "komorebi-windows") | .version'`
version := `cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.name == "komorebi") | .version'`
schemapub:
rm -Force komorebi-schema
+32
View File
@@ -0,0 +1,32 @@
[package]
name = "komorebi"
version = "0.1.42"
description = "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 daemon of each platform is a library (`komorebi-windows`, `komorebi-linux`, `komorebi-macos`) with a
# `daemon::run` that is the old main; this package is the one `komorebi` binary and calls the one of the
# target OS. A dependency key has one path, so each library has a key of its own.
[dependencies]
color-eyre = { workspace = true }
[target.'cfg(windows)'.dependencies]
komorebi-windows = { package = "komorebi-windows", path = "../komorebi", default-features = false }
[target.'cfg(target_os = "linux")'.dependencies]
komorebi-linux = { package = "komorebi-linux", path = "../komorebi-for-kde/komorebi", default-features = false }
[target.'cfg(target_os = "macos")'.dependencies]
komorebi-macos = { package = "komorebi-macos", path = "../komorebi-for-mac/komorebi", default-features = false }
[features]
default = ["schemars"]
deadlock_detection = ["komorebi-windows/deadlock_detection", "komorebi-linux/deadlock_detection", "komorebi-macos/deadlock_detection"]
schemars = ["komorebi-windows/schemars", "komorebi-linux/schemars", "komorebi-macos/schemars"]
[target.'cfg(target_os = "linux")'.dev-dependencies]
serde_json = { workspace = true }
+10
View File
@@ -0,0 +1,10 @@
//! `komorebi`, the tiling window manager daemon, for Windows, KDE Plasma and macOS: the daemon of the target
//! OS is a library of its own and this binary runs it.
fn main() -> color_eyre::eyre::Result<()> {
cfg_select! {
target_os = "windows" => komorebi_windows::daemon::run(),
target_os = "linux" => komorebi_linux::daemon::run(),
target_os = "macos" => komorebi_macos::daemon::run(),
}
}
@@ -1,3 +1,4 @@
#![cfg(target_os = "linux")]
//! The daemon and its `komorebi.json`: `komorebi --fake-backend` finds the file in the config home
//! or is given it with `--config`, is configured by it, and applies it again when the file changes.
//!
@@ -1,3 +1,4 @@
#![cfg(target_os = "linux")]
//! `komorebi` connects to KWin unless it is told to run against the in-memory desktop, says
//! what went wrong when it cannot, and then leaves the socket of a komorebi that is running
//! alone.
@@ -1,3 +1,4 @@
#![cfg(target_os = "linux")]
//! The daemon over its socket: `komorebi --fake-backend` answers on `komorebi.sock` in its
//! runtime directory, and stops when it is sent `Stop`.
+27
View File
@@ -0,0 +1,27 @@
#![cfg(target_os = "linux")]
//! `komorebi --version` reports the workspace version.
use std::process::Command;
#[test]
fn reports_the_package_version() {
let output = Command::new(env!("CARGO_BIN_EXE_komorebi"))
.arg("--version")
.output()
.expect("komorebi runs");
assert!(output.status.success());
let stdout = String::from_utf8(output.stdout).expect("utf-8 output");
// the version the KDE daemon reports is that of the KDE `version` crate (the workspace version of
// komorebi for KDE), not of this package, which is shared with the other platforms
let manifest = include_str!("../../komorebi-for-kde/version/Cargo.toml");
let version = manifest
.lines()
.find_map(|line| line.strip_prefix("version = \""))
.and_then(|rest| rest.strip_suffix('"'))
.expect("the version crate has a version");
let expected = format!("komorebi {version}");
assert_eq!(stdout.lines().next(), Some(expected.as_str()));
}
+5
View File
@@ -38,6 +38,11 @@ allow = [
]
confidence-threshold = 0.8
[[licenses.clarify]]
crate = "komorebi"
expression = "LicenseRef-Komorebi-2.0"
license-files = []
[[licenses.clarify]]
crate = "komorebi-linux"
expression = "LicenseRef-Komorebi-2.0"
+14 -2
View File
@@ -97,8 +97,19 @@
"komorebi-client/tests"
]
|| pkgs.lib.hasPrefix "komorebi-client/tests/linux_" relative;
# the one komorebi binary package: its manifest, main.rs and tests
komorebiDaemon =
builtins.elem relative [
"komorebi-daemon"
"komorebi-daemon/Cargo.toml"
"komorebi-daemon/src"
"komorebi-daemon/src/main.rs"
"komorebi-daemon/tests"
]
|| pkgs.lib.hasPrefix "komorebi-daemon/tests/linux_" relative;
in
((rootCrate || rootCrateParent || komorebic || komorebiClient) && !(pkgs.lib.hasSuffix "/Cargo.lock" path) || relative == "Cargo.toml" || relative == "Cargo.lock" || inTree)
((rootCrate || rootCrateParent || komorebic || komorebiClient || komorebiDaemon) && !(pkgs.lib.hasSuffix "/Cargo.lock" path) || relative == "Cargo.toml" || relative == "Cargo.lock" || inTree)
&&
# the VM tests (their library, scripts and the states they keep) are not built, so
# editing one does not change the source the daemon is built from
@@ -131,9 +142,10 @@
pkgs.lib.hasPrefix "${platformDir}/" member
|| member == "komorebic"
|| member == "komorebi-client"
|| member == "komorebi-daemon"
|| builtins.any (crate: member == crate || pkgs.lib.hasPrefix "${crate}/" member) rootCrates;
};
packages = "-p komorebi-linux -p komorebic -p komorebi-client -p komorebi-hotkeys";
packages = "-p komorebi -p komorebi-linux -p komorebic -p komorebi-client -p komorebi-hotkeys";
workspaceArgs = {
pname = "komorebi-workspace";
version = (builtins.fromTOML (builtins.readFile ./komorebi/Cargo.toml)).package.version;
-4
View File
@@ -61,7 +61,3 @@ schemars = ["dep:schemars", "komorebi-collections/schemars", "komorebi-core/sche
[lib]
name = "komorebi"
[[bin]]
name = "komorebi"
path = "src/main.rs"
@@ -3,15 +3,15 @@
//! The daemon owns the layout of every window and asks the compositor, through a backend, to
//! put each one where the layout says.
//!
//! The backend is KWin's ([`komorebi::kwin`]): the daemon connects to the session bus, loads its
//! The backend is KWin's ([`crate::kwin`]): the daemon connects to the session bus, loads its
//! script into KWin and waits for the script to report the desktop. `--fake-backend` replaces it
//! with an in-memory desktop with one monitor and no windows, for development and testing.
//!
//! The daemon starts from `komorebi.json`: the file `--config` names, or else the one in
//! [`struct@HOME_DIR`] when there is one ([`komorebi::static_config`]), which it reloads whenever
//! [`struct@HOME_DIR`] when there is one ([`crate::static_config`]), which it reloads whenever
//! it changes. Without a file it runs on its defaults. It loads the monitors and the windows
//! that are open, gives each monitor the configuration the file has for it, asks for the borders
//! it draws ([`komorebi::border_manager`]), tiles the windows, listens for messages on
//! it draws ([`crate::border_manager`]), tiles the windows, listens for messages on
//! `komorebi.sock` in [`struct@DATA_DIR`], handles the events the backend reports and the changes
//! of the monitors on threads of their own, and runs until it is stopped, with `SIGINT`,
//! `SIGTERM` or a `Stop` message.
@@ -19,7 +19,7 @@
//! With a key binding file (`--keybindings`, or the first of `skhdrc`, `whkdrc` and `sxhkdrc` in
//! [`struct@HOME_DIR`]), the daemon also runs the engine of [`komorebi_hotkeys`]: it registers the
//! keys of the bindings that are not static shortcuts with KWin's global shortcut daemon and runs
//! their commands ([`komorebi::kwin::hotkeys::load`]). A file that cannot be read is logged, and
//! their commands ([`crate::kwin::hotkeys::load`]). A file that cannot be read is logged, and
//! the window manager runs without keys. The bindings it takes are the engine's part of the file's
//! plan in `--keybindings-mode`, the mode `komorebic hotkeys compile --mode` wrote the static
//! shortcuts in. `--chord-timeout` is how long the next key of a chord chain is waited for, and
@@ -36,21 +36,21 @@
use clap::Parser;
use clap::ValueEnum;
use color_eyre::eyre;
use komorebi::DATA_DIR;
use komorebi::HOME_DIR;
use komorebi::LOG_DIR;
use komorebi::backend;
use komorebi::backend::fake::FakeBackend;
use komorebi::border_manager;
use komorebi::core::pathext::replace_env_in_path;
use komorebi::kwin::hotkeys::Keybindings;
use komorebi::monitor_reconciliator;
use komorebi::process_command::listen_for_commands;
use komorebi::process_event::listen_for_events;
use komorebi::static_config::StaticConfig;
use komorebi::static_config::StaticConfigExt;
use komorebi::window_manager::WindowManager;
use komorebi::window_manager_event_listener;
use crate::DATA_DIR;
use crate::HOME_DIR;
use crate::LOG_DIR;
use crate::backend;
use crate::backend::fake::FakeBackend;
use crate::border_manager;
use crate::core::pathext::replace_env_in_path;
use crate::kwin::hotkeys::Keybindings;
use crate::monitor_reconciliator;
use crate::process_command::listen_for_commands;
use crate::process_event::listen_for_events;
use crate::static_config::StaticConfig;
use crate::static_config::StaticConfigExt;
use crate::window_manager::WindowManager;
use crate::window_manager_event_listener;
use komorebi_hotkeys::Format;
use komorebi_hotkeys::engine::EngineOptions;
use komorebi_hotkeys::plan::PlanMode;
@@ -269,7 +269,7 @@ fn app_alias(value: &str) -> Result<(String, Vec<String>), String> {
Ok((name.trim().to_string(), aliases))
}
fn main() -> eyre::Result<()> {
pub fn run() -> eyre::Result<()> {
let opts: Opts = Opts::parse();
let (_guard, _color_guard) = setup(opts.log_level.clone())?;
@@ -282,7 +282,7 @@ fn main() -> eyre::Result<()> {
backend::set_backend(Arc::new(FakeBackend::with_one_monitor()));
} else {
tracing::info!("connecting to KWin");
backend::set_backend(komorebi::kwin::connect()?);
backend::set_backend(crate::kwin::connect()?);
}
#[cfg(feature = "deadlock_detection")]
@@ -339,7 +339,7 @@ fn main() -> eyre::Result<()> {
{
let mut wm = wm.lock();
border_manager::update_colours(&wm);
komorebi::transparency_manager::apply(&mut wm);
crate::transparency_manager::apply(&mut wm);
}
monitor_reconciliator::listen_for_notifications(wm.clone())?;
@@ -365,7 +365,7 @@ fn main() -> eyre::Result<()> {
app_aliases,
},
};
if let Err(error) = komorebi::kwin::hotkeys::load(keybindings) {
if let Err(error) = crate::kwin::hotkeys::load(keybindings) {
tracing::error!("the key bindings are not active: {error}");
}
}
@@ -383,11 +383,11 @@ fn main() -> eyre::Result<()> {
{
let mut wm = wm.lock();
wm.restore_all_windows(false)?;
komorebi::transparency_manager::restore(&mut wm);
crate::transparency_manager::restore(&mut wm);
}
backend::backend().shutdown();
let sockets = komorebi::SUBSCRIPTION_SOCKETS.lock();
let sockets = crate::SUBSCRIPTION_SOCKETS.lock();
for path in (*sockets).values() {
if let Ok(stream) = UnixStream::connect(path) {
stream.shutdown(Shutdown::Both)?;
+1
View File
@@ -64,6 +64,7 @@ extern crate komorebi_collections;
pub use komorebi_collections::ring;
pub mod daemon;
pub mod animation;
pub mod backend;
pub mod border_manager;
@@ -1,18 +0,0 @@
//! `komorebi --version` reports the workspace version.
use std::process::Command;
#[test]
fn reports_the_package_version() {
let output = Command::new(env!("CARGO_BIN_EXE_komorebi"))
.arg("--version")
.output()
.expect("komorebi runs");
assert!(output.status.success());
let stdout = String::from_utf8(output.stdout).expect("utf-8 output");
let expected = format!("komorebi {}", env!("CARGO_PKG_VERSION"));
assert_eq!(stdout.lines().next(), Some(expected.as_str()));
}
+5
View File
@@ -43,6 +43,11 @@ allow = [
]
confidence-threshold = 0.8
[[licenses.clarify]]
crate = "komorebi"
expression = "LicenseRef-Komorebi-2.0"
license-files = []
[[licenses.clarify]]
crate = "komorebi-macos"
expression = "LicenseRef-Komorebi-2.0"
+13 -2
View File
@@ -93,8 +93,18 @@
"komorebi-bar/src/main.rs"
]
|| pkgs.lib.hasPrefix "komorebi-bar/src/macos" relative;
# the one komorebi binary package: its manifest, main.rs and tests
komorebiDaemon =
builtins.elem relative [
"komorebi-daemon"
"komorebi-daemon/Cargo.toml"
"komorebi-daemon/src"
"komorebi-daemon/src/main.rs"
"komorebi-daemon/tests"
];
in
((rootCrate || komorebic || komorebiClient || komorebiBar) && !(pkgs.lib.hasSuffix "/Cargo.lock" path) || relative == "Cargo.toml" || relative == "Cargo.lock" || inTree)
((rootCrate || komorebic || komorebiClient || komorebiBar || komorebiDaemon) && !(pkgs.lib.hasSuffix "/Cargo.lock" path) || relative == "Cargo.toml" || relative == "Cargo.lock" || inTree)
&& (
(craneLib.filterCargoSources path type)
|| (pkgs.lib.hasInfix "/docs/" path)
@@ -113,10 +123,11 @@
pkgs.lib.hasPrefix "${platformDir}/" member
|| member == "komorebic"
|| member == "komorebi-client"
|| member == "komorebi-daemon"
|| member == "komorebi-bar"
|| builtins.any (crate: member == crate || pkgs.lib.hasPrefix "${crate}/" member) rootCrates;
};
packages = "-p komorebi-macos -p komorebic -p komorebi-client -p komorebi-bar";
packages = "-p komorebi -p komorebi-macos -p komorebic -p komorebi-client -p komorebi-bar";
workspaceArgs = {
pname = "komorebi-workspace";
inherit version;
-4
View File
@@ -138,7 +138,3 @@ schemars = ["dep:schemars", "komorebi-collections/schemars", "komorebi-core/sche
[lib]
name = "komorebi"
[[bin]]
name = "komorebi"
path = "src/main.rs"
@@ -4,26 +4,26 @@ use clap::Parser;
use clap::ValueEnum;
use color_eyre::eyre;
use color_eyre::eyre::OptionExt;
use komorebi::CoreFoundationRunLoop;
use komorebi::DATA_DIR;
use komorebi::HOME_DIR;
use komorebi::border_manager;
use komorebi::core::pathext::replace_env_in_path;
use komorebi::display_reconfiguration_listener::DisplayReconfigurationListener;
use komorebi::input_event_listener;
use komorebi::input_event_listener::InputEventListener;
use komorebi::monitor_reconciliator;
use komorebi::notification_center_listener::NotificationCenterListener;
use komorebi::process_command::listen_for_commands;
use komorebi::process_event::listen_for_events;
use komorebi::reaper;
use komorebi::settle;
use komorebi::static_config::StaticConfig;
use komorebi::static_config::StaticConfigExt;
use komorebi::theme_manager;
use komorebi::window_manager::WindowManager;
use komorebi::window_manager_event_listener;
use komorebi::workspace_reconciliator;
use crate::CoreFoundationRunLoop;
use crate::DATA_DIR;
use crate::HOME_DIR;
use crate::border_manager;
use crate::core::pathext::replace_env_in_path;
use crate::display_reconfiguration_listener::DisplayReconfigurationListener;
use crate::input_event_listener;
use crate::input_event_listener::InputEventListener;
use crate::monitor_reconciliator;
use crate::notification_center_listener::NotificationCenterListener;
use crate::process_command::listen_for_commands;
use crate::process_event::listen_for_events;
use crate::reaper;
use crate::settle;
use crate::static_config::StaticConfig;
use crate::static_config::StaticConfigExt;
use crate::theme_manager;
use crate::window_manager::WindowManager;
use crate::window_manager_event_listener;
use crate::workspace_reconciliator;
use objc2::MainThreadMarker;
use objc2::rc::autoreleasepool;
use objc2_app_kit::NSApplication;
@@ -200,7 +200,7 @@ struct Opts {
log_level: LogLevel,
}
fn main() -> eyre::Result<()> {
pub fn run() -> eyre::Result<()> {
let opts: Opts = Opts::parse();
let (_guard, _color_guard) = setup(opts.log_level)?;
@@ -350,11 +350,11 @@ fn main() -> eyre::Result<()> {
}
// nothing may move a window once they have all been put back where they were found
komorebi::animation::animator::shutdown();
crate::animation::animator::shutdown();
wm.lock().restore_all_windows(false)?;
let sockets = komorebi::SUBSCRIPTION_SOCKETS.lock();
let sockets = crate::SUBSCRIPTION_SOCKETS.lock();
for path in (*sockets).values() {
if let Ok(stream) = UnixStream::connect(path) {
stream.shutdown(Shutdown::Both)?;
+1
View File
@@ -43,6 +43,7 @@ extern crate komorebi_collections;
pub use komorebi_collections::ring;
pub mod daemon;
pub mod accessibility;
pub mod animation;
pub mod app_kit_notification_constants;
-4
View File
@@ -83,7 +83,3 @@ schemars = [
[lib]
name = "komorebi"
[[bin]]
name = "komorebi"
path = "src/main.rs"
+31 -31
View File
@@ -20,10 +20,10 @@ use clap::ValueEnum;
use color_eyre::eyre;
use color_eyre::eyre::bail;
use crossbeam_utils::Backoff;
use komorebi::animation::ANIMATION_ENABLED_GLOBAL;
use komorebi::animation::ANIMATION_ENABLED_PER_ANIMATION;
use komorebi::animation::AnimationEngine;
use komorebi::replace_env_in_path;
use crate::animation::ANIMATION_ENABLED_GLOBAL;
use crate::animation::ANIMATION_ENABLED_PER_ANIMATION;
use crate::animation::AnimationEngine;
use crate::replace_env_in_path;
use parking_lot::Mutex;
#[cfg(feature = "deadlock_detection")]
use parking_lot::deadlock;
@@ -35,29 +35,29 @@ use tracing_subscriber::EnvFilter;
use tracing_subscriber::layer::SubscriberExt;
use uds_windows::UnixStream;
use komorebi::CUSTOM_FFM;
use komorebi::DATA_DIR;
use komorebi::HOME_DIR;
use komorebi::INITIAL_CONFIGURATION_LOADED;
use komorebi::SESSION_ID;
use komorebi::border_manager;
use komorebi::focus_manager;
use komorebi::load_configuration;
use komorebi::monitor_reconciliator;
use komorebi::process_command::listen_for_commands;
use komorebi::process_command::listen_for_commands_tcp;
use komorebi::process_event::listen_for_events;
use komorebi::process_movement::listen_for_movements;
use komorebi::reaper;
use komorebi::stackbar_manager;
use komorebi::state::State;
use komorebi::static_config::StaticConfig;
use komorebi::static_config::StaticConfigExt;
use komorebi::theme_manager;
use komorebi::transparency_manager;
use komorebi::window_manager::WindowManager;
use komorebi::windows_api::WindowsApi;
use komorebi::winevent_listener;
use crate::CUSTOM_FFM;
use crate::DATA_DIR;
use crate::HOME_DIR;
use crate::INITIAL_CONFIGURATION_LOADED;
use crate::SESSION_ID;
use crate::border_manager;
use crate::focus_manager;
use crate::load_configuration;
use crate::monitor_reconciliator;
use crate::process_command::listen_for_commands;
use crate::process_command::listen_for_commands_tcp;
use crate::process_event::listen_for_events;
use crate::process_movement::listen_for_movements;
use crate::reaper;
use crate::stackbar_manager;
use crate::state::State;
use crate::static_config::StaticConfig;
use crate::static_config::StaticConfigExt;
use crate::theme_manager;
use crate::transparency_manager;
use crate::window_manager::WindowManager;
use crate::windows_api::WindowsApi;
use crate::winevent_listener;
fn setup(log_level: LogLevel) -> eyre::Result<(WorkerGuard, WorkerGuard)> {
if std::env::var("RUST_LIB_BACKTRACE").is_err() {
@@ -172,7 +172,7 @@ enum LogLevel {
}
#[derive(Parser)]
#[clap(name = "komorebi", author, about, version = komorebi::build::CLAP_LONG_VERSION)]
#[clap(name = "komorebi", author, about, version = crate::build::CLAP_LONG_VERSION)]
struct Opts {
/// Allow the use of komorebi's custom focus-follows-mouse implementation
#[clap(short, long = "ffm")]
@@ -197,7 +197,7 @@ struct Opts {
#[tracing::instrument]
#[allow(clippy::cognitive_complexity)]
fn main() -> eyre::Result<()> {
pub fn run() -> eyre::Result<()> {
let opts: Opts = Opts::parse();
CUSTOM_FFM.store(opts.focus_follows_mouse, Ordering::SeqCst);
@@ -342,7 +342,7 @@ fn main() -> eyre::Result<()> {
}
listen_for_events(wm.clone());
komorebi::live_resize::listen_for_steps(wm.clone());
crate::live_resize::listen_for_steps(wm.clone());
if CUSTOM_FFM.load(Ordering::SeqCst) {
listen_for_movements(wm.clone());
@@ -373,7 +373,7 @@ fn main() -> eyre::Result<()> {
WindowsApi::disable_focus_follows_mouse()?;
}
let sockets = komorebi::SUBSCRIPTION_SOCKETS.lock();
let sockets = crate::SUBSCRIPTION_SOCKETS.lock();
for path in (*sockets).values() {
if let Ok(stream) = UnixStream::connect(path) {
stream.shutdown(Shutdown::Both)?;
+1
View File
@@ -3,6 +3,7 @@
#[macro_use]
extern crate komorebi_collections;
pub mod daemon;
pub mod animation;
pub mod border_manager;
pub mod cloaked;