feat: add exclusive tag + minor refactor

This commit is contained in:
atagen 2025-06-23 00:34:43 +10:00
parent 66d1dfacda
commit 0997b124a2
4 changed files with 114 additions and 76 deletions

View file

@ -21,6 +21,7 @@ enum Commands {
EnableTag { tag: u8 },
DisableTag { tag: u8 },
ToggleTag { tag: u8 },
ExclusiveTag { tag: u8 },
}
impl From<Commands> for niri_tag::TagCmd {
@ -32,6 +33,7 @@ impl From<Commands> for niri_tag::TagCmd {
Commands::EnableTag { tag } => TagCmd::EnableTag(tag),
Commands::DisableTag { tag } => TagCmd::DisableTag(tag),
Commands::ToggleTag { tag } => TagCmd::ToggleTag(tag),
Commands::ExclusiveTag { tag } => TagCmd::ExclusiveTag(tag),
}
}
}
@ -47,6 +49,7 @@ fn main() -> Result<()> {
EnableTag { tag } if tag > 0 => (),
DisableTag { tag } if tag > 0 => (),
ToggleTag { tag } if tag > 0 => (),
ExclusiveTag { .. } => (),
_ => return Err(anyhow!("Can't change tag 0!")),
};