In a multiple monitor set-up, is there a way to transfer entire workspaces (as opposed to single applications) to a different monitor?
3 Answers
You can define a binding in your i3 config. Note: windows are called "containers", and monitors are called "outputs". The relevant documentation is here.
move workspace to output left|right|down|up|current|primary|nonprimary|next|<output1>
Here's what I use in my config:
# move focused workspace between monitors
bindsym $mod+Ctrl+greater move workspace to output right
bindsym $mod+Ctrl+less move workspace to output left
Strangely, I'd expect the $mod+Ctrl+greater to require me to hit Ctrl and Shift at the same time, since you need to press Shift to type < and >. However, pressing just mod, Ctrl, and , works, which is very nice.
Note, you can also set a keybinding to send things to a specific monitor by its name.
-
2is there a way to do this using the workspace name/number? Instead of the active workspaceThayne– Thayne2018-12-14 05:29:53 +00:00Commented Dec 14, 2018 at 5:29
-
Good question. I don't know.Ricardo Decal– Ricardo Decal2018-12-19 14:39:24 +00:00Commented Dec 19, 2018 at 14:39
-
It works perfectly.Tural Asgarov– Tural Asgarov2022-11-29 09:23:29 +00:00Commented Nov 29, 2022 at 9:23
-
@Thayne Looks like you need to focus the appropriate workspace first (using something like
focus output primaryor other options at i3wm.org/docs/userguide.html#_focusing_moving_containers ). Then you can move the workspace.waterproof– waterproof2024-02-22 16:38:01 +00:00Commented Feb 22, 2024 at 16:38
The workspace can be explicitly specified by name like this, for values of workspace_name and output_name:
i3-msg '[workspace="workspace_name"]' move workspace to output output_index
Note that if you name your workspaces like 1:first, you use 1 not first.
-
-
1You can get the workspace name using
i3-msg -t get_workspacesand the monitor name usingxrandr. To move workspace 2 to monitor DP-1, usei3-msg '[workspace="2"]' move workspace to output "DP-1"srgsanky– srgsanky2024-08-27 05:13:00 +00:00Commented Aug 27, 2024 at 5:13
To move to the next workspace, you can use:
bindsym $mod+Ctrl+greater move workspace to output next
This has the advantage of being agnostic as to the position of the workspace - it just cycles through them, no matter if they are up or down or whatever.