Skip to content

Commit

Permalink
fix(wm): ensure await-configuration is opt-in
Browse files Browse the repository at this point in the history
  • Loading branch information
LGUG2Z committed Aug 12, 2022
1 parent f669231 commit 52b7b8d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,10 @@ with many retile events.
If you would like to avoid this, you can start `komorebi` with a flag which tells `komorebi` to wait until all configuration
has been loaded before listening to and responding to window manager events: `komorebic start --await-configuration`.

If you start `komorebi` with the `--await-configuration` flag, you _must_ send the `komorebic complete-configuration` command
at the end of your `komorebi.ahk` config. The layout will not be updated and `komorebi` will not respond to `komorebic`
commands until this command has been received.
If you start `komorebi` with the `--await-configuration` flag, you _must_ send the `komorebic complete-configuration`
command at the end of the configuration section of your `komorebi.ahk` config (before you start defining the key
bindings). The layout will not be updated and `komorebi` will not respond to `komorebic` commands until this command has
been received.

#### Floating Windows

Expand Down
2 changes: 1 addition & 1 deletion komorebi-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "komorebi-core"
version = "0.1.11"
version = "0.1.12"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion komorebi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "komorebi"
version = "0.1.11"
version = "0.1.12"
authors = ["Jade Iqbal <[email protected]>"]
description = "A tiling window manager for Windows"
categories = ["tiling-window-manager", "windows"]
Expand Down
13 changes: 9 additions & 4 deletions komorebi/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ pub fn load_configuration() -> Result<()> {
Command::new("AutoHotkey64.exe")
.arg(config_v2.as_os_str())
.output()?;
} else {
INITIAL_CONFIGURATION_LOADED.store(true, Ordering::SeqCst);
};
}

Ok(())
}
Expand Down Expand Up @@ -443,7 +441,14 @@ fn main() -> Result<()> {

wm.lock().init()?;
listen_for_commands(wm.clone());
std::thread::spawn(|| load_configuration().expect("could not load configuration"));

if !opts.await_configuration && !INITIAL_CONFIGURATION_LOADED.load(Ordering::SeqCst) {
INITIAL_CONFIGURATION_LOADED.store(true, Ordering::SeqCst);
};

std::thread::spawn(|| {
load_configuration().expect("could not load configuration");
});

if opts.await_configuration {
let backoff = Backoff::new();
Expand Down
2 changes: 1 addition & 1 deletion komorebic/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "komorebic"
version = "0.1.11"
version = "0.1.12"
authors = ["Jade Iqbal <[email protected]>"]
description = "The command-line interface for Komorebi, a tiling window manager for Windows"
categories = ["cli", "tiling-window-manager", "windows"]
Expand Down

0 comments on commit 52b7b8d

Please sign in to comment.