style(macos): format the macOS code with the project's rustfmt settings

Pure formatting, no other change: nightly rustfmt --edition 2024 with
komorebi-for-mac/rustfmt.toml (imports_granularity = Item) over
komorebi-for-mac/**/*.rs and the macOS modules in the shared directories
komorebic/src/macos and komorebi-bar/src/macos. 11 files; the kfm fmt check
of the previous revision reported them. Windows and KDE code is not touched,
and the Windows source filter excludes those macos files, so no Windows or
KDE derivation changes.

Verified: the rustfmt --check command of the fmt check passes on the result
locally; nix eval of drvPath in a throwaway git copy: Windows deps and
clippy, kfde deps, clippy and vm stacks are identical before and after it.
This commit is contained in:
LGUG2Z committed 2026-11-05 15:03:26 -08:00
1 parent 081e373782
commit e95d146bae
11 files changed
+44 -38

No files matched your search

+4 -2
View File
@@ -127,7 +127,8 @@ pub fn main() -> eyre::Result<()> {
);
if opts.quickstart {
let komorebi_bar_json = include_str!("../../../komorebi-for-mac/docs/komorebi.bar.example.json").to_string();
let komorebi_bar_json =
include_str!("../../../komorebi-for-mac/docs/komorebi.bar.example.json").to_string();
std::fs::write(home_dir.join("komorebi.bar.json"), komorebi_bar_json)?;
println!(
"Example komorebi.bar.json file written to {}",
@@ -148,7 +149,8 @@ pub fn main() -> eyre::Result<()> {
let mut config = match config_path {
None => {
let komorebi_bar_json =
include_str!("../../../komorebi-for-mac/docs/komorebi.bar.example.json").to_string();
include_str!("../../../komorebi-for-mac/docs/komorebi.bar.example.json")
.to_string();
std::fs::write(&default_config_path, komorebi_bar_json)?;
tracing::info!(
+8 -8
View File
@@ -7,14 +7,6 @@ use crate::macos::config::WorkspacesDisplayFormat;
use crate::macos::render::RenderConfig;
use crate::macos::selected_frame::SelectableFrame;
use crate::macos::ui::CustomUi;
pub use komorebi_bar_core::widgets::komorebi_config::KomorebiConfig;
pub use komorebi_bar_core::widgets::komorebi_config::KomorebiConfigurationSwitcherConfig;
pub use komorebi_bar_core::widgets::komorebi_config::KomorebiFocusedContainerConfig;
pub use komorebi_bar_core::widgets::komorebi_config::KomorebiLayoutConfig;
pub use komorebi_bar_core::widgets::komorebi_config::KomorebiLockedContainerConfig;
pub use komorebi_bar_core::widgets::komorebi_config::KomorebiWorkspaceLayerConfig;
pub use komorebi_bar_core::widgets::komorebi_config::KomorebiWorkspacesConfig;
pub use komorebi_bar_core::widgets::komorebi_config::KomorebiLayout;
use crate::macos::widgets::komorebi_layout::KomorebiLayoutExt;
use crate::macos::widgets::widget::BarWidget;
use eframe::egui::Align;
@@ -39,6 +31,14 @@ use eframe::egui::vec2;
use icns::IconFamily;
use icns::IconType;
use image::RgbaImage;
pub use komorebi_bar_core::widgets::komorebi_config::KomorebiConfig;
pub use komorebi_bar_core::widgets::komorebi_config::KomorebiConfigurationSwitcherConfig;
pub use komorebi_bar_core::widgets::komorebi_config::KomorebiFocusedContainerConfig;
pub use komorebi_bar_core::widgets::komorebi_config::KomorebiLayout;
pub use komorebi_bar_core::widgets::komorebi_config::KomorebiLayoutConfig;
pub use komorebi_bar_core::widgets::komorebi_config::KomorebiLockedContainerConfig;
pub use komorebi_bar_core::widgets::komorebi_config::KomorebiWorkspaceLayerConfig;
pub use komorebi_bar_core::widgets::komorebi_config::KomorebiWorkspacesConfig;
use komorebi_client::Container;
use komorebi_client::PathExt;
use komorebi_client::Rect;
-1
View File
@@ -1,4 +1,3 @@
pub use komorebi_bar_core::widgets::applications;
pub use komorebi_bar_core::widgets::battery;
pub use komorebi_bar_core::widgets::cpu;
+2 -2
View File
@@ -1,6 +1,4 @@
use crate::macos::bar::Alignment;
pub use komorebi_bar_core::widgets::network_config::NetworkConfig;
pub use komorebi_bar_core::widgets::network_config::NetworkSelectConfig;
use crate::macos::config::LabelPrefix;
use crate::macos::render::RenderConfig;
use crate::macos::selected_frame::SelectableFrame;
@@ -12,6 +10,8 @@ use eframe::egui::Label;
use eframe::egui::TextFormat;
use eframe::egui::Ui;
use eframe::egui::text::LayoutJob;
pub use komorebi_bar_core::widgets::network_config::NetworkConfig;
pub use komorebi_bar_core::widgets::network_config::NetworkSelectConfig;
use num_derive::FromPrimitive;
use parking_lot::Mutex;
use std::fmt;
+1 -1
View File
@@ -11,9 +11,9 @@ use crate::macos::widgets::update::Update;
use eframe::egui::Context;
use eframe::egui::Ui;
use komorebi_bar_core::render::RenderConfig;
pub use komorebi_bar_core::widgets::widget::BarWidget;
pub use komorebi_bar_core::widgets::widget::WidgetConfig;
use komorebi_bar_core::render::RenderConfig;
/// Stands in for a widget that macOS cannot run; `WidgetConfig::enabled` is false for those, so
/// this is never built from a configuration that the bar loads.
@@ -1,8 +1,8 @@
use crate::core::animation::AnimationStyle;
pub use komorebi_config::animation::PerAnimationPrefixConfig;
use parking_lot::Mutex;
pub use prefix::AnimationPrefix;
pub use komorebi_config::animation::PerAnimationPrefixConfig;
use std::collections::HashMap;
use std::sync::Arc;
use std::sync::LazyLock;
@@ -26,7 +26,6 @@ pub mod tracks;
pub mod transition;
pub mod workspace_transition;
pub const DEFAULT_ANIMATION_ENABLED: bool = false;
pub const DEFAULT_ANIMATION_STYLE: AnimationStyle = AnimationStyle::Linear;
pub const DEFAULT_ANIMATION_DURATION: u64 = 250;
+4 -4
View File
@@ -1,9 +1,5 @@
#![warn(clippy::all)]
use clap::Parser;
use clap::ValueEnum;
use color_eyre::eyre;
use color_eyre::eyre::OptionExt;
use crate::CoreFoundationRunLoop;
use crate::DATA_DIR;
use crate::HOME_DIR;
@@ -24,6 +20,10 @@ use crate::theme_manager;
use crate::window_manager::WindowManager;
use crate::window_manager_event_listener;
use crate::workspace_reconciliator;
use clap::Parser;
use clap::ValueEnum;
use color_eyre::eyre;
use color_eyre::eyre::OptionExt;
use objc2::MainThreadMarker;
use objc2::rc::autoreleasepool;
use objc2_app_kit::NSApplication;
+1 -1
View File
@@ -43,7 +43,6 @@ extern crate komorebi_collections;
pub use komorebi_collections::ring;
pub mod daemon;
pub mod accessibility;
pub mod animation;
pub mod app_kit_notification_constants;
@@ -54,6 +53,7 @@ pub mod border_manager;
pub mod container;
pub mod core;
pub mod core_graphics;
pub mod daemon;
pub mod display_reconfiguration_listener;
pub mod input_event_listener;
pub mod ioreg;
+14 -12
View File
@@ -1,4 +1,3 @@
use komorebi_settings::shared::SharedDelta;
use crate::CoreFoundationRunLoop;
use crate::DATA_DIR;
use crate::DEFAULT_MOUSE_FOLLOWS_FOCUS;
@@ -50,6 +49,7 @@ use color_eyre::eyre;
use crossbeam_channel::Receiver;
use hotwatch::EventKind;
use hotwatch::Hotwatch;
use komorebi_settings::shared::SharedDelta;
use komorebi_themes::colour::Colour;
use objc2_core_foundation::CFRetained;
use objc2_core_foundation::CFRunLoop;
@@ -332,12 +332,8 @@ impl From<&WindowManager> for StaticConfig {
// border_style: Option::from(STYLE.load()),
// border_z_order: None,
// border_implementation: Option::from(IMPLEMENTATION.load()),
default_workspace_padding: Option::from(
crate::settings::workspace_padding(),
),
default_container_padding: Option::from(
crate::settings::container_padding(),
),
default_workspace_padding: Option::from(crate::settings::workspace_padding()),
default_container_padding: Option::from(crate::settings::container_padding()),
layout_defaults: {
let guard = crate::settings::layout_defaults();
if guard.is_empty() {
@@ -369,7 +365,9 @@ impl From<&WindowManager> for StaticConfig {
// slow_application_identifiers: Option::from(SLOW_APPLICATION_IDENTIFIERS.lock().clone()),
// bar_configurations: None,
// remove_titlebar_applications: Option::from(NO_TITLEBAR.lock().clone()),
floating_window_aspect_ratio: Option::from(crate::settings::floating_window_aspect_ratio()),
floating_window_aspect_ratio: Option::from(
crate::settings::floating_window_aspect_ratio(),
),
// window_handling_behaviour: Option::from(WINDOW_HANDLING_BEHAVIOUR.load()),
tabbed_applications: None,
..Default::default()
@@ -823,8 +821,10 @@ impl StaticConfigExt for StaticConfig {
let mut value = Self::read(path)?;
let mut wm = wm.lock();
let configs_with_preference: Vec<_> =
crate::settings::display_index_preferences().keys().copied().collect();
let configs_with_preference: Vec<_> = crate::settings::display_index_preferences()
.keys()
.copied()
.collect();
let mut configs_used = Vec::new();
let mut workspace_matching_rules = WORKSPACE_MATCHING_RULES.lock();
@@ -986,8 +986,10 @@ impl StaticConfigExt for StaticConfig {
value.apply_globals()?;
let configs_with_preference: Vec<_> =
crate::settings::display_index_preferences().keys().copied().collect();
let configs_with_preference: Vec<_> = crate::settings::display_index_preferences()
.keys()
.copied()
.collect();
let mut configs_used = Vec::new();
let mut workspace_matching_rules = WORKSPACE_MATCHING_RULES.lock();
@@ -1,4 +1,3 @@
use crate::monitor::MonitorExt;
use crate::AccessibilityUiElement;
use crate::CoreFoundationRunLoop;
use crate::DATA_DIR;
@@ -41,6 +40,7 @@ use crate::current_space_id;
use crate::lockable_sequence::Lockable;
use crate::macos_api::MacosApi;
use crate::monitor::Monitor;
use crate::monitor::MonitorExt;
use crate::pan::Pan;
use crate::ring::Ring;
use crate::scrolling::WorkspaceScrolling;
@@ -1548,7 +1548,8 @@ impl WindowManager {
let hiding_position = self
.focused_monitor()
.ok_or_eyre("there is no monitor")?
.extra.window_hiding_position;
.extra
.window_hiding_position;
let workspace = self.focused_workspace_mut()?;
workspace.new_monocle_container()?;
@@ -1584,7 +1585,8 @@ impl WindowManager {
let hiding_position = self
.focused_monitor()
.ok_or_eyre("there is no monitor")?
.extra.window_hiding_position;
.extra
.window_hiding_position;
self.focused_workspace_mut()?
.cycle_monocle_container(direction)?;
+4 -2
View File
@@ -278,9 +278,11 @@ pub fn main() -> eyre::Result<()> {
std::fs::create_dir_all(data_dir)?;
let mut komorebi_json =
include_str!("../../../komorebi-for-mac/docs/komorebi.example.json").to_string();
include_str!("../../../komorebi-for-mac/docs/komorebi.example.json")
.to_string();
let komorebi_bar_json =
include_str!("../../../komorebi-for-mac/docs/komorebi.bar.example.json").to_string();
include_str!("../../../komorebi-for-mac/docs/komorebi.bar.example.json")
.to_string();
if std::env::var("KOMOREBI_CONFIG_HOME").is_ok() {
komorebi_json =