summaryrefslogtreecommitdiff
path: root/test.rc
blob: 11135a5b8c77df7addb8237457c1b851eedea6bf (plain) (blame)
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
#!/bin/rc

rfork n

delay=0.25

guifs -s testgui

dir=/mnt/gui
sleep $delay

# split the window vertically into two, and make the top one a textbox
echo vertical >> $dir/props/orientation
textdir=$dir/`{cat $dir/clone}
echo textbox >> $textdir/type

fn show {
	echo -n $* >> $textdir/props/text
}

dir=$dir/`{cat $dir/clone}

colours=(FF0000 00FF00 0000FF FFFF00 00FFFF FF00FF FFFFFF 333333)
for(colour in $colours){
	dir=$dir/`{cat $dir/clone}			# Create a new sub element in the gui (for now, always a "container")
	echo $colour^FF >> $dir/props/background	# Set the background
	show 'setting background of '^$dir^' to 0x'^$colour
	sleep $delay					# Wait a bit
}

# Now do the same, but don't nest the elements
for(colour in $colours){
	subdir=$dir/`{cat $dir/clone}
	echo $colour^FF >> $subdir/props/background
	show 'setting background of '^$subdir^' to 0x'^$colour
	sleep $delay
}

# Add some padding to all elements
for(f in `{walk /mnt/gui/ | grep 'padding$'}){
	echo 10 >> $f
	show 'echo 10 >> '^$f
	sleep $delay
}

# Add a border to the innermost elements
for(f in `{walk /mnt/gui | grep $dir'/[0-9]+/props/border$'}){
	echo 8888CCFF >> $f^colour
	echo 5 >> $f
	show 'echo 5 >> '^$f
	sleep $delay
}

# Add some margin to the innermost elements
for(f in `{walk /mnt/gui | grep $dir'/[0-9]+/props/margin'}){
	echo 5 >> $f
	show 'echo 5 >> '^$f
	sleep $delay
}

# Make the inner container vertical
echo vertical >> $dir/props/orientation
show 'echo vertical >> '^$dir/props/orientation

# when the script ends, the old text window draws over the gui. I will fix that later.
# For now, i just make the script sleep for a long time
sleep 1000000