aboutsummaryrefslogtreecommitdiff
path: root/niri-ipc
diff options
context:
space:
mode:
authorrustysec <russ@infocyte.com>2024-05-16 14:30:52 -0700
committerIvan Molodetskikh <yalterz@gmail.com>2024-05-17 10:33:00 +0300
commit36d3e70f11bde96eb67d157b22ebcdf4767af0c2 (patch)
treef03cad743d95094e0d3eb37b26568006c5298806 /niri-ipc
parenta2f74c9bff953c9f3318cb642785f02c6f5fe5d3 (diff)
downloadniri-36d3e70f11bde96eb67d157b22ebcdf4767af0c2.tar.gz
niri-36d3e70f11bde96eb67d157b22ebcdf4767af0c2.tar.bz2
niri-36d3e70f11bde96eb67d157b22ebcdf4767af0c2.zip
Implement niri msg workspaces
Diffstat (limited to 'niri-ipc')
-rw-r--r--niri-ipc/src/lib.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/niri-ipc/src/lib.rs b/niri-ipc/src/lib.rs
index b0f124f9..b57860d8 100644
--- a/niri-ipc/src/lib.rs
+++ b/niri-ipc/src/lib.rs
@@ -31,6 +31,8 @@ pub enum Request {
/// Configuration to apply.
action: OutputAction,
},
+ /// Request information about workspaces.
+ Workspaces,
/// Respond with an error (for testing error handling).
ReturnError,
}
@@ -60,6 +62,8 @@ pub enum Response {
FocusedWindow(Option<Window>),
/// Output configuration change result.
OutputConfigChanged(OutputConfigChanged),
+ /// Information about workspaces.
+ Workspaces(Vec<Workspace>),
}
/// Actions that niri can perform.
@@ -484,6 +488,23 @@ pub enum OutputConfigChanged {
OutputWasMissing,
}
+/// A workspace.
+#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
+pub struct Workspace {
+ /// Index of the workspace on its monitor.
+ ///
+ /// This is the same index you can use for requests like `niri msg action focus-workspace`.
+ pub idx: u8,
+ /// Optional name of the workspace.
+ pub name: Option<String>,
+ /// Name of the output that the workspace is on.
+ ///
+ /// Can be `None` if no outputs are currently connected.
+ pub output: Option<String>,
+ /// Whether the workspace is currently active on its output.
+ pub is_active: bool,
+}
+
impl FromStr for WorkspaceReferenceArg {
type Err = &'static str;