Browse Source

Added a script to smartly split the screen in i3

Samuel W. Flint 7 years ago
parent
commit
a07ba8a3d6
1 changed files with 11 additions and 0 deletions
  1. 11 0
      i3-smart-split

+ 11 - 0
i3-smart-split

@@ -0,0 +1,11 @@
+#!/bin/sh
+
+RES=$(xwininfo -id `xdotool getwindowfocus` | grep -E '(Width|Height)' | awk '{print $2}')
+
+IFS=" " read var1 var2 <<< $RES
+
+if [ $var1 -gt $var2 ]; then
+    i3-msg split h
+else
+    i3-msg split v
+fi