-
Notifications
You must be signed in to change notification settings - Fork 0
/
makeLayout.sh
executable file
·108 lines (106 loc) · 2.73 KB
/
makeLayout.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# This script creates the layout file for i3 to load, the parameter is the size (resolution) you want
sub=$(( $1 - 1 ))
echo '{
"border": "none",
"current_border_width": 0,
"floating": "auto_off",
"geometry": {
"height": 316,
"width": 484,
"x": 0,
"y": 0
},
"marks": [],
"name": "amiotnoe@ido:~",
"percent": 0.21875,
"swallows": [
{
"class": "^XTerm$"
}
],
"type": "con"
}
'
echo '
{
// splith split container with 1 children
"border": "normal",
"floating": "auto_off",
"layout": "splith",
"marks": [],
"percent": 0.5625,
"type": "con",
"nodes": [
{
// splith split container with '$1' children
"border": "normal",
"floating": "auto_off",
"layout": "splith",
"marks": [],
"percent": 1,
"type": "con",
"nodes": ['
for ((i =0; i <= $sub; i++)); do
echo '
{
// splitv split container with '$1' children
"border": "normal",
"floating": "auto_off",
"layout": "splitv",
"marks": [],
"percent": 0.05,
"type": "con",
"nodes": ['
for ((j = 0; j <= $sub; j++)); do
echo ' {
"border": "none",
"current_border_width": 0,
"floating": "auto_off",
"geometry": {
"height": 316,
"width": 484,
"x": 0,
"y": 0
},
"marks": [],
"name": "amiotnoe@ido:~",
"percent": 0.05,
"swallows": [
{
"title": "^badapple'$((i * $1 + j))'$"
}
],
"type": "con"
}';
[[ $j -eq $sub ]] && { echo ""; } || { echo ","; }
done
echo ' ]
}';
[[ $i -eq $sub ]] && { echo ""; } || { echo ","; }
done
echo ' ]
}
]
}
'
echo '
{
"border": "none",
"current_border_width": 0,
"floating": "auto_off",
"geometry": {
"height": 316,
"width": 484,
"x": 0,
"y": 0
},
"marks": [],
"name": "amiotnoe@ido:~",
"percent": 0.21875,
"swallows": [
{
"class": "^XTerm$"
}
],
"type": "con"
}'