The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

Friendly names to workspaces don't work with "move container"

asked Dec 17 '15

this post is marked as community wiki

This post is a wiki. Anyone with karma >100 is welcome to improve it.

Note: there is a relevant question ("1657/add-friendly-name-to-workspace-but-keep-numbers-for-shortcuts") whose link I cannot post since I don't have enough karma. However, that question seems to address only the part about directly switching to a workspace, not moving a container to a workspace.

I frequently rename my workspaces in an ad-hoc manner to easily see the names of the programs running in each workspace (and know where to switch). E.g. I have names like: "1: web, 2: code, 3: dbvis, 4: email" etc. These friendly names are prefixed with a number so that bindings like the following:

# switch to workspace
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3

... do in fact work. What doesn't work however is bindings for the move container to workspace commands. E.g. the following don't work:

# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3

Instead, when I press $mod+Shift+1 a new workspace named "1" is created (alongside the already existing workspace "1: web") and the window is moved there.

2 answers

Sort by » oldest newest most voted
2

answered Dec 17 '15

Airblader gravatar image

Why would the syntax for moving be different from switching? Just use

# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
0

answered Dec 17 '15

basletic gravatar image

updated Dec 17 '15

This works as expected:

# switch to workspace
bindsym $mod+1 workspace number 1: web
bindsym $mod+2 workspace number 2: code

# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1: web
bindsym $mod+Shift+2 move container to workspace 2: code; workspace 2: code

Note that $mod+Shift+2 will both move container to workspace 2 and go to workspace 2.

Comments

This won't work with dynamically renamed workspaces, though.

Airblader gravatar imageAirblader (Dec 17 '15)edit

@Airblader Indeed, it might not work in dynamical 'scenario'.

basletic gravatar imagebasletic (Dec 17 '15)edit

Question Tools

1 follower

Stats

Asked: Dec 17 '15

Seen: 30 times

Last updated: Dec 17