I'm rather green with Plan 9... this is my first attempt to use it in any kind of serious way. I really like upas/fs and I wanted to be able to check multiple email accounts simultaneously. To this end I wrote a couple of scripts to set the upasname environment variable and fire up faces and acme in a special way [rather like Andrey Mirtchovski's stuff he showed me many months back].
I decided that since we don't have virutal desktops and I don't have enough money for a huge plasma screen monitor that it'd be at least be nice to be able to somehow group these windows together. The natural way seemed to be to have "sub-rio" sessions within my main one and use those entire sessions from the higher level to keep the grouping of all those related windows togther.
This was fairly easily done. However upon minimizing the rio windows I found that, for some reason, the main-rio showed both rio windows as being labeled "rio". Obviously for more than two email accounts [heck, even one] being managed in this way would be prone to the error of restoring the wrong one from time to time.
Well the first thing I thought of was how does this label get written? Rio presents a filesystem interface to the windows it manages and each window can set its own label in the following way:
echo -n newlabel > /dev/label
This would make it very easy for me to set my label then startup rio right? NOPE. Turns out, after much searching through rc [fruitlessly, I should have known rc was rio independent] and rio as well as rio's constituent libraries [libdraw being the last one I searched and, of course, the most fruitful one :-)] that rio itself was responsible for clobbering my previously set label.
I found in the libdraw code that if the label presented to the libdraw initialization function was nil [Plan 9 C's better NULL] it would not attempt to overwrite my /dev/label settings. Instantly I began to add a new command line parameter to rio [-l for "noLabel".. terrible name]. I recompiled and sure enough it worked great. Some discussion on the #plan9 irc channel helped me think that this was perhaps not the best way to handle this.
So I appealed to my friends on 9fans about what I wanted to do and what the best way to do it would be. Turns out Russ Cox was silently lurking and scanning the irc chat room log files. He writes to me that I can simply do the following from an rc session:
echo -n text > /dev/label bind /dev/null /dev/label rio...
This was a rather enlightening experience for me as I could see how the dynamic filesystem of plan 9 actually saved me from having to write new code. How flexible! How convenient! I immediately trashed my molested version of rio and restored the older version from yesterday [another great program pulling the old blocks from my write-once storage].
Now all that was left was some time to wrap up my new found knowledge in a set of scripts that would set up my environment for me. That's what I will be sticking on this page next.