Skip to content

Commit 5e28905

Browse files
lukeyou05LGUG2Z
authored andcommitted
feat(masir): switched to negative boolean for twm integration options
BREAKING CHANGE: To disable integrations, you must use the --disable-integrations argument when launching masir
1 parent b3eeefd commit 5e28905

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/main.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ enum MatchingStrategy {
4848
#[derive(Parser)]
4949
#[clap(author, about, version)]
5050
struct Opts {
51-
/// Enable komorebi integration to avoid raising unmanaged windows
51+
/// Disable automatic integrations with tiling window managers (e.g. komorebi)
5252
#[clap(long)]
53-
komorebi: bool,
53+
disable_integrations: bool,
5454
/// Path to a file with known focus-able HWNDs (e.g. komorebi.hwnd.json)
5555
#[clap(long)]
5656
hwnds: Option<PathBuf>,
@@ -60,20 +60,20 @@ fn main() -> Result<()> {
6060
let opts: Opts = Opts::parse();
6161

6262
let hwnds = match opts.hwnds {
63+
None if opts.disable_integrations => None,
6364
None => {
65+
let hwnds: PathBuf = dirs::data_local_dir()
66+
.expect("there is no local data directory")
67+
.join("komorebi")
68+
.join("komorebi.hwnd.json");
69+
6470
// TODO: We can add checks for other window managers here
65-
let hwnds_option = if opts.komorebi {
66-
Some(
67-
dirs::data_local_dir()
68-
.expect("there is no local data directory")
69-
.join("komorebi")
70-
.join("komorebi.hwnd.json"),
71-
)
71+
72+
if hwnds.is_file() {
73+
Some(hwnds)
7274
} else {
7375
None
74-
};
75-
76-
hwnds_option.filter(|hwnds| hwnds.is_file())
76+
}
7777
}
7878
Some(hwnds) => {
7979
if hwnds.is_file() {

0 commit comments

Comments
 (0)