bspwm_auto_balance: limit effect to longest_side scheme

This commit is contained in:
Protesilaos Stavrou 2023-10-09 06:53:11 +03:00
parent 9ef2a2a3fe
commit fd5ced30c6
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -29,12 +29,15 @@ _top-or-bottom ()
while IFS= read -r line
do
# Balance only when splitting side-by-side.
if _left-or-right @east || _left-or-right @west
if [ $(bspc config automatic_scheme) == "longest_side" ]
then
bspc node @/ --balance
elif _top-or-bottom @north || _top-or-bottom @south
then
bspc node @north --balance || bspc node @south --balance
# Balance only when splitting side-by-side.
if _left-or-right @east || _left-or-right @west
then
bspc node @/ --balance
elif _top-or-bottom @north || _top-or-bottom @south
then
bspc node @north --balance || bspc node @south --balance
fi
fi
done < <(bspc subscribe node_add node_remove)