niri-tag/lib/main.rs

39 lines
745 B
Rust

use std::collections::HashMap;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub enum TagCmd {
AddTagToWin(u8),
RemoveTagFromWin(u8),
EnableTag(u8),
DisableTag(u8),
ToggleTagOnWin(u8),
ToggleTag(u8),
ExclusiveTag(u8),
}
#[derive(Serialize, Deserialize, Debug)]
pub enum TagEvent {
TagEmpty(u8),
TagOccupied(u8),
TagUrgent(u8),
TagEnabled(u8),
TagDisabled(u8),
TagExclusive(u8),
TagFullState(HashMap<u8, TagState>),
}
#[derive(Serialize, Deserialize, Debug)]
pub struct TagState {
pub enabled: bool,
pub occupied: bool,
pub urgent: bool,
}
#[derive(Default, Deserialize)]
pub struct Config {
pub prepopulate: u8,
pub strict: bool,
}