move + goto workspace when moving a container empties the focused workspace
My current keybindings look something like this:
# switch to workspace
bindsym $mod+1 workspace $ws1
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
# move focused container to workspace, then goto that workspace
bindsym $mod+Control+1 move container to workspace $ws1; workspace $ws1
I want to modify my environment in the following manner:
- Move a focused container to a new workspace.
- If the current workspace is empty (as a result of the moved container) ...
- ... automatically goto to new workspace.
You can write a script e.g. in Python and use `i3-msg -t get_tree` to receive some data (see http://i3wm.org/docs/ipc.html#_tree_reply). You'll have to parse the nodes of the current workspace to figure out whether it is empty yourself, though.