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 2015-10-01 00:58:04 +0000

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.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-10-01 03:07:55 +0000

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.)

edit flag offensive delete link more

Comments

Cool thanks that will work!

jefeyay gravatar imagejefeyay ( 2015-10-07 20:50:27 +0000 )edit

Question Tools

1 follower

Stats

Asked: 2015-10-01 00:58:04 +0000

Seen: 53 times

Last updated: Oct 01