I'm running i3 version 4.16
I would like to bind a shortcut to move the current container to the next/previous workspace whether existing or not.
With help from this post using jq, I have a 'sort of' working solution but it is very flaky (sometimes it switches to the workspace without moving the container and sometimes it moves a container from the next ws to the current ws before switching ws)
Can anyone come up with a better solution ???
My i3 config:
set $ws-right "$(( $( i3-msg -t get_workspaces | jq '.[] | select(.focused).num' ) + 1))";
set $ws-left "$(( $( i3-msg -t get_workspaces | jq '.[] | select(.focused).num' ) - 1))";
bindsym shift+control+$mod+Left exec i3-msg move container to workspace $ws-left; exec i3-msg workspace $ws-left
bindsym shift+control+$mod+Right exec i3-msg move container to workspace $ws-right; exec i3-msg workspace $ws-right
Thx for your time ;)