summaryrefslogtreecommitdiff
path: root/test.rc
diff options
context:
space:
mode:
authorPeter Mikkelsen <petermikkelsen10@gmail.com>2024-02-15 20:39:09 +0000
committerPeter Mikkelsen <petermikkelsen10@gmail.com>2024-02-15 20:39:09 +0000
commit3a0e0b8bb6e7fd9bcf510167980d9715e3faeb7b (patch)
tree17f5aaaddf15ea6c8bbb0043e89f87be0ce7021e /test.rc
parent0ad54d136ef33d61172658e97b538f7cd6a91c26 (diff)
Even more work :)
Diffstat (limited to 'test.rc')
-rwxr-xr-xtest.rc22
1 files changed, 13 insertions, 9 deletions
diff --git a/test.rc b/test.rc
index 11135a5..46710f8 100755
--- a/test.rc
+++ b/test.rc
@@ -1,13 +1,8 @@
#!/bin/rc
-rfork n
-
-delay=0.25
-
-guifs -s testgui
+delay=0.1
dir=/mnt/gui
-sleep $delay
# split the window vertically into two, and make the top one a textbox
echo vertical >> $dir/props/orientation
@@ -62,6 +57,15 @@ for(f in `{walk /mnt/gui | grep $dir'/[0-9]+/props/margin'}){
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
+fn printevents {
+ while(event = `''{read}){
+ show $1': '$event
+ }
+}
+
+# Attach an event printer to the innermost elements
+for(f in `{walk /mnt/gui | grep $dir'/[0-9]+/event'}){
+ printevents $f <$f >[2]/dev/null &
+}
+
+wait