Notes on Plan 9’s window system
9front’s rio
rio is Plan 9’s default window manager. It’s the first graphical interface that will greet you.
Most interactions with rio will be through mouse chording. The left button is dedicated to selection, while the right and middle buttons are tied to contextual actions.
First Steps
To create a window, press right button, select “New” and draw its area with the right button. Beside the other options from the menu, you can resize or move a window by dragging its border with the left or the right button.
You will mostly work with text on Plan 9. One of the first shortcut you will need is to cut/copy and paste. Select some text with the left button. Cut it with the middle button. Paste it back or somewhere else with right click. Snarf is the Plan 9 word for copy.
Another common shortcut is cursor navigation. ctrl-a
will move the cursor at the beginning of the line, and ctrl-e
to the end of it. ctrl-a + left
will move your cursor one line up, ctrl-e + right
will move it one line down.
You can autocomplete file path with ctrl-f
.
Window Management
Moving windows
You can set a window coordinates and size.
To launch acme in the top right corner of your monitor when your rio session starts, create the following script:
#!/bin/rc
window -r (941 0 1280 111) acme
/rc/bin/riostarter
You can invoke it with from your profile or from the terminal file with the following command.
% chmod +x /bin/riostarter
% rio -i riostarter
Subrio
You can launch another rio inside your current session, acting as a pseudo virtual space.
Hide and reveal your subrios with the “Hide” command from the parent rio right button menu.
Environement
Edit $home/lib/profile
to your liking. Use it set variables, script rio sessions, or invoke scripts from /rc/bin
(which is bound to /bin/
).
Fonts
Fonts are installed in /lib/font/bit
.
% lc /lib/font/bit
MAP dejavusans/ jis/ pelm/
big5/ dejavusansbd/ lucida/ shinonome/
courier/ dejavusansbi/ lucidasans/ smiley/
dejavu/ dejavusansit/ lucm/ special/
dejavubd/ fixed/ misc/ terminus/
dejavubi/ gb/ naga10/ times/
dejavuit/ germgoth/ palatino/ vga/
To set terminus at size 12 as the default font, create the following variable.
font=/lib/font/bit/terminus/unicode.12.font
$home/lib/profile
You can install third-party fonts. Plan 9 have its own font format, subf. Convert your bitmaps with this set of tools. 9front support TrueType fonts thanks to truetypefs(4).
File Interface
You can manipulate Plan 9’s windows content, image output, keyboard events, and so on, by working with their interface file.
These files will be in /dev
for the current window, and in /mnt/wsys/wsys
for other windows.
- cons
- Console
- consctl
- Console control
- cursor
- Cursor look
- kbd
- Keyboard events
- label
- Window’s name
- mouse
- Mouse events
- screen
- Screen visual output
- snarf
- Clipboard
- text
- window’s text
- wctl
- Window control
- wdir
- Window’s pwd
- winid
- Window’s id
- window
- window’s visual output
- wsys
- Subdirectories for rio’s windows.
Questions or corrections: roy@royniang.com.