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

shortcut to move window to next workspace

asked Oct 1 '15

jefeyay gravatar image

I created shortcuts to move focused containers to 'next' and 'prev', but is it possible to have shortcuts that move containers to the next available workspace? For example, I have windows open in workspaces 1, 2, and 3 and I currently have a focused container on 3. When I use the shortcut to 'move container to workspace next', it goes to 1. Is there a way to create a shortcut similar to this only instead of going to the next workspace in use, go to the next available. So in this case go to workspace 4 instead of 1. Thank you.

1 answer

Sort by » oldest newest most voted
1

answered Oct 1 '15

i3convert gravatar image

One solution is to write a script that parses the output of the shell command i3-msg -t get_workspaces to figure out the number of the next workspace you are interested in. Then issue i3-msg "move container to workspace number your-number".

(I personally like to use Python for this, since it comes with a nice JSON parsing library.)

Comments

Cool thanks that will work!

jefeyay gravatar imagejefeyay (Oct 7 '15)edit

Question Tools

1 follower

Stats

Asked: Oct 1 '15

Seen: 53 times

Last updated: Oct 01