mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Implement niri msg workspaces
This commit is contained in:
committed by
Ivan Molodetskikh
parent
a2f74c9bff
commit
36d3e70f11
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user