diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-08-25 09:38:45 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-08-25 09:38:45 +0300 |
| commit | f19e1711a7999f9b4d97cf1a1b2e03f273b2f120 (patch) | |
| tree | aa9832280c4e604f1ed0d962e39c096449e90214 /niri-ipc | |
| parent | 20cd4f5d0470d1755f351c53eb2c0f63c27529cf (diff) | |
| download | niri-f19e1711a7999f9b4d97cf1a1b2e03f273b2f120.tar.gz niri-f19e1711a7999f9b4d97cf1a1b2e03f273b2f120.tar.bz2 niri-f19e1711a7999f9b4d97cf1a1b2e03f273b2f120.zip | |
Add niri msg keyboard-layouts
Diffstat (limited to 'niri-ipc')
| -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; |
