aboutsummaryrefslogtreecommitdiff
path: root/niri-ipc
diff options
context:
space:
mode:
authorKirottu <56396750+Kirottu@users.noreply.github.com>2025-01-25 10:49:51 +0200
committerGitHub <noreply@github.com>2025-01-25 08:49:51 +0000
commit852da5714affd067de731599136ed619dc3bba40 (patch)
treee42514f81d8a7f74f5437746503367082917777a /niri-ipc
parent4f793038117b4fef38f491e665a66589eb896e0a (diff)
downloadniri-852da5714affd067de731599136ed619dc3bba40.tar.gz
niri-852da5714affd067de731599136ed619dc3bba40.tar.bz2
niri-852da5714affd067de731599136ed619dc3bba40.zip
Add move-workspace-to-index and move-workspace-to-monitor actions (#1007)
* Added move-workspace-to-index and move-workspace-to-monitor IPC actions * Added redraws to the workspace handling actions, fixed tests that panicked, fixed other mentioned problems. * Fixed workspace focusing and handling numbered workspaces with `move-workspace-to-index` * Fixed more inconsistencies with move-workspace-to-monitor * Added back `self.workspace_switch = None` * Reordered some workspace cleanup logic * Fix formatting * Add missing blank lines * Fix moving workspace to same monitor and wrong current index updating * Move function up and add fixme comment --------- Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
Diffstat (limited to 'niri-ipc')
-rw-r--r--niri-ipc/src/lib.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/niri-ipc/src/lib.rs b/niri-ipc/src/lib.rs
index 513da578..44ef1d94 100644
--- a/niri-ipc/src/lib.rs
+++ b/niri-ipc/src/lib.rs
@@ -365,6 +365,22 @@ pub enum Action {
MoveWorkspaceDown {},
/// Move the focused workspace up.
MoveWorkspaceUp {},
+ /// Move a workspace to a specific index on its monitor.
+ #[cfg_attr(
+ feature = "clap",
+ clap(about = "Move the focused workspace to a specific index on its monitor")
+ )]
+ MoveWorkspaceToIndex {
+ /// New index for the workspace.
+ #[cfg_attr(feature = "clap", arg())]
+ index: usize,
+
+ /// Reference (index or name) of the workspace to move.
+ ///
+ /// If `None`, uses the focused workspace.
+ #[cfg_attr(feature = "clap", arg(long))]
+ reference: Option<WorkspaceReferenceArg>,
+ },
/// Set the name of a workspace.
#[cfg_attr(
feature = "clap",
@@ -519,6 +535,22 @@ pub enum Action {
MoveWorkspaceToMonitorPrevious {},
/// Move the focused workspace to the next monitor.
MoveWorkspaceToMonitorNext {},
+ /// Move a workspace to a specific monitor.
+ #[cfg_attr(
+ feature = "clap",
+ clap(about = "Move the focused workspace to a specific monitor")
+ )]
+ MoveWorkspaceToMonitor {
+ /// The target output name.
+ #[cfg_attr(feature = "clap", arg())]
+ output: String,
+
+ // Reference (index or name) of the workspace to move.
+ ///
+ /// If `None`, uses the focused workspace.
+ #[cfg_attr(feature = "clap", arg(long))]
+ reference: Option<WorkspaceReferenceArg>,
+ },
/// Toggle a debug tint on windows.
ToggleDebugTint {},
/// Toggle visualization of render element opaque regions.