i3-smart-split 211 B

1234567891011
  1. #!/bin/sh
  2. RES=$(xwininfo -id `xdotool getwindowfocus` | grep -E '(Width|Height)' | awk '{print $2}')
  3. IFS=" " read var1 var2 <<< $RES
  4. if [ $var1 -gt $var2 ]; then
  5. i3-msg split h
  6. else
  7. i3-msg split v
  8. fi