[download]

config/i3/move

   1 #!/bin/bash
   2 
   3 a=$(i3-msg -t get_tree)
   4 i3-msg move "$@"
   5 b=$(i3-msg -t get_tree)
   6 
   7 [[ $a == "$b" ]] || exit
   8 
   9 w=$(i3-msg -t get_workspaces | jq '.[] | select(.focused == true).num')
  10 [[ $w == 1 ]] && w=11
  11 l=$(( w - 1 ))
  12 r=$(( w % 10 + 1 ))
  13 
  14 [[ $1 == left  ]] && i3-msg move to workspace $l\; workspace $l
  15 [[ $1 == right ]] && i3-msg move to workspace $r\; workspace $r