The i3 FAQ has migrated to https://www.reddit.com/r/i3wm/. All content here is read-only.
Ask Your Question
0

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

asked 2015-12-17 13:08:22 +0000

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.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2015-12-17 14:19:27 +0000

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
edit flag offensive delete link more
0

answered 2015-12-17 14:42:30 +0000

basletic gravatar image

updated 2015-12-17 14:43:23 +0000

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.

edit flag offensive delete link more

Comments

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

Airblader gravatar imageAirblader ( 2015-12-17 16:21:16 +0000 )edit

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

basletic gravatar imagebasletic ( 2015-12-17 17:17:49 +0000 )edit

Question Tools

1 follower

Stats

Asked: 2015-12-17 13:08:22 +0000

Seen: 30 times

Last updated: Dec 17