File: insertion

package info (click to toggle)
bspwm 0.9.10-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 868 kB
  • sloc: ansic: 11,968; sh: 336; makefile: 85; python: 38
file content (46 lines) | stat: -rwxr-xr-x 1,185 bytes parent folder | download | duplicates (4)
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