summaryrefslogtreecommitdiff
path: root/test.rc
diff options
context:
space:
mode:
Diffstat (limited to 'test.rc')
-rwxr-xr-xtest.rc38
1 files changed, 22 insertions, 16 deletions
diff --git a/test.rc b/test.rc
index 9c04f75..8ee1e20 100755
--- a/test.rc
+++ b/test.rc
@@ -5,12 +5,12 @@ delay=0.1
dir=/mnt/gui
# split the window vertically into two, and make the top one a textbox
-echo vertical >> $dir/props/orientation
+echo vertical > $dir/props/orientation
textdir=$dir/`{cat $dir/clone}
-echo textbox >> $textdir/type
+echo textbox > $textdir/type
fn show {
- echo -n $* >> $textdir/props/text
+ echo $* >> $textdir/props/text
}
dir=$dir/`{cat $dir/clone}
@@ -18,7 +18,7 @@ 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
+ echo $colour^FF > $dir/props/background # Set the background
show 'setting background of '^$dir^' to 0x'^$colour
sleep $delay # Wait a bit
}
@@ -26,39 +26,41 @@ for(colour in $colours){
# 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
+ 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
+ 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
+ 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
+ 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
+echo vertical > $dir/props/orientation
+show 'echo vertical > '^$dir/props/orientation
+nl='
+'
fn printevents {
- while(event = `''{read}){
+ while(event = `''{read | tr -d $nl}){
show $1': '$event
}
}
@@ -70,7 +72,11 @@ for(f in `{walk /mnt/gui | grep $dir'/[0-9]+/event'}){
# Create a right-click menu on the text field
echo 'R/this is a/right click/menu' >> /mnt/gui/0/props/menus
+
# Also attach an event printer to the text field
-printevents 'text field' </mnt/gui/0/event >[2]/dev/null &
+# printevents 'text field' </mnt/gui/0/event >[2]/dev/null &
+
+# Reset the textfield contents
+echo -n > /mnt/gui/0/props/text
wait