diff options
Diffstat (limited to 'niri-ipc/src/lib.rs')
| -rw-r--r-- | niri-ipc/src/lib.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/niri-ipc/src/lib.rs b/niri-ipc/src/lib.rs index 713db8af..ecf202f2 100644 --- a/niri-ipc/src/lib.rs +++ b/niri-ipc/src/lib.rs @@ -36,6 +36,8 @@ pub enum Request { Workspaces, /// Request information about the focused output. FocusedOutput, + /// Request information about the keyboard layout. + KeyboardLayouts, /// Respond with an error (for testing error handling). ReturnError, } @@ -70,6 +72,8 @@ pub enum Response { Workspaces(Vec<Workspace>), /// Information about the focused output. FocusedOutput(Option<Output>), + /// Information about the keyboard layout. + KeyboardLayouts(KeyboardLayouts), } /// Actions that niri can perform. @@ -566,6 +570,16 @@ pub struct Workspace { pub is_active: bool, } +/// Configured keyboard layouts. +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] +pub struct KeyboardLayouts { + /// XKB names of the configured layouts. + pub names: Vec<String>, + /// Index of the currently active layout in `names`. + pub current_idx: u8, +} + impl FromStr for WorkspaceReferenceArg { type Err = &'static str; |
