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