1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#! /bin/sh
. ./prelude
bspc monitor -a "test-insertion"
bspc desktop -f "test-insertion"
# Automatic mode
window add 2
split_type_a=$(bspc query -T -n @/ | jshon -e splitType -u)
window add
split_type_b=$(bspc query -T -n @/2 | jshon -e splitType -u)
[ "$split_type_a" = "$split_type_b" ] && fail "Non-vacant node insertion should rotate brother."
split_type_a=$(bspc query -T -n @/ | jshon -e splitType -u)
bspc rule -a Test:test -o state=floating
window add
split_type_b=$(bspc query -T -n @/2 | jshon -e splitType -u)
[ "$split_type_a" = "$split_type_b" ] || fail "Vacant node insertion shouldn't rotate brother."
window remove
# Manual mode
for dir in north west south east ; do
child=1
split_type=vertical
[ "$dir" = "south" -o "$dir" = "east" ] && child=2
[ "$dir" = "north" -o "$dir" = "south" ] && split_type=horizontal
bspc node -p $dir
window add
[ "$(bspc query -N -n)" = "$(bspc query -N -n @parent/${child})" ] || fail "Wrong child polarity for ${dir} preselection."
[ "$(bspc query -T -n @parent | jshon -e splitType -u)" = "$split_type" ] || fail "Wrong split type for ${dir} preselection."
done
window remove 7
bspc desktop "test-insertion" -r
|