[raw] [dotfiles.tar.gz]
   1 #!/bin/bash
   2 
   3 c_gp=$(i3-msg -t get_config | awk '/^gaps\s+inner/ { print $3 }')
   4 c_gp=${c_gp:-0}
   5 
   6 i3-msg -t subscribe -m '[ "window", "binding" ]' | while read; do
   7     ws=$(i3-msg -t get_workspaces | jq '.[] | select(.focused == true).num')
   8     gp=$(i3-msg -t get_tree | jq "recurse(.nodes[]) | select(.num == $ws).gaps.inner + $c_gp")
   9 
  10     i3-msg [tiling workspace=__focused__] border normal $(( $gp == 0 ? 2 : 0 ))
  11 done