In which we not so much dip our toes into the pool, or even get our swim trunks on, but rather go on at length about how to buy the appropriate snorkle.
I have a wonderful laptop with a trackpad and touchscreen, very cutting edge and hip, with a cool Jack Kirby sticker on the back. I do most of my computing at home these days slouched on the couch.
Plan 9 is not amused. The wonderful Notes on the Plan 9(tm) 3rd Edition Kernel Source encourages me to use the acme editor to browse it, and at the very least I should be using acme to browse the source code of the system itself. To use Plan 9 without acme, it seems, is to enjoy the smell of the steak but not the taste- in acme’s distinctive point of view is something essential to the plan 9 ess…
In which we not so much dip our toes into the pool, or even get our swim trunks on, but rather go on at length about how to buy the appropriate snorkle.
I have a wonderful laptop with a trackpad and touchscreen, very cutting edge and hip, with a cool Jack Kirby sticker on the back. I do most of my computing at home these days slouched on the couch.
Plan 9 is not amused. The wonderful Notes on the Plan 9(tm) 3rd Edition Kernel Source encourages me to use the acme editor to browse it, and at the very least I should be using acme to browse the source code of the system itself. To use Plan 9 without acme, it seems, is to enjoy the smell of the steak but not the taste- in acme’s distinctive point of view is something essential to the plan 9 essential point of view (or so the stories seem to imply).
And part of that distinctive acme point of view is to be proudly unusable on my hardware, and to encourage me to go back to playing Candy Crush Pokemon with Friends on my Nintendopad if I’m not ready to use a three-button mouse with the big kids.
I have no mouse, nor do I have a surface on which to roll it. What I do have (in addition to the space-age cave-man pointing devices built into my futuristic laptop) is an ancient Logitech “Marble Mouse” trackball, now carried across three states and many more homes in the bottom of a box labeled “Joe’s Computer Stuff”. It works great, it’s reasonably comfortable to use, it doesn’t require a table to work on, and it has two optional “feature” buttons in addition to the standard right and left buttons. This means I can still sit on my couch and watch America’s Funniest Home Videos while browsing the kernel source using the appropriate tools.
Provided I can get the feature buttons thing working as middle buttons on my host system, a shiny new Ubuntu 14.10
All of the above is a long explanation of why this, the first entry in my Plan 9 diary, will be all about customizing hardware for a late model Linux.
I am aware of the irony, thank you.
As always, I begin with Google. Very quickly I find some instructions on configuring my particular trackball with X on the Ubuntu help Wiki, but the instructions seem ancient and I don’t really trust them. The relevant configuration directory on my machine has no knowledge of the trackball I want to use, and seems to have exactly the files for the pointing devices I had with me before I plugged the trackball in. I’m afraid that this directory is now owned by some very smart configurator, in the way that late model Linuxes tend to do, who will be very disappointed with me indeed if I just start throwing my own hand-rolled configuration files into it’s directory.
Eventually, I gave up and followed the old document’s advice, adding a file named “50-marblemouse-joe.conf” into my /usr/share/xorg.conf.d/ directory. The final contents I went with were
Section "InputClass"
Identifier "Marble Mouse"
MatchProduct "Logitech USB Trackball"
MatchIsPointer "on"
Driver "evdev"
Option "ButtonMapping" "1 2 3 4 5 6 7 2 2"
EndSection
In my cargo-cult understanding, I believe this file to do the following, css like operation on my input setup:
- Assert a set of predicates (The hardware declares itself to be product “Logitech USB Trackball”, the hardware is a pointer)
- Identify the matched device with the string “Marble Mouse” (when asked? With respect to other rules? Who knows?)
50-
- Use the “evdev” driver (this appears to be necessary because evdev is the site of the “ButtonMapping” option)
- NOW, having observed the proper forms, remap physical mouse buttons one through nine, respectively, to themselves, except for 8 and 9, which are mapped to button 2
(I got these impressions by reading about xorg.conf in the general sense, and then the evdev driver in particular. I wrote the file, copied it into my system directory at /usr/share/xorg.conf.d/, said a quick prayer and rebooted.
And apparently succeeded! I measured my success by
- Successfully booting into the graphical login without crashing X
- Testing my mouse using xev, and observing that the weird back and forward buttons on my trackball instead reported themselves a button 2
- Finally (and gloriously) seeing the “cut/paste/snarf…” menu in 9term when I clicked one of the inner buttons
So that was a while well spent, however, there are two dangling threads, like fibers of spinach caught in my teeth, preventing me from truly enjoying the salad of system-fiddling success. The first issue is a nagging suspicion that someday I’ll find out how contemporary Ubuntu hardware customization is supposed to happen, and my custom file in xorg.conf.d will conflict with or block or otherwise foul up some more appropriately of-the-mode attempt to customize my environment or worse, foul up a similar attempt by some script in a software package I try to install. Of course, at that time I’ll have no memory of any of this, and it’ll just be another bit of system cruft I’ll end up working around.
The second issue is that I have no knowledge, or even confidence in the possibility, that when the time comes to install Plan 9 on hardware, that I will be able to do anything similar. A Raspberry Pi B+, earmarked for just this purpose, even now slouches toward my mailbox to be booted- when it arrives, I’ll have to find some other input device.
Stay tuned, dear readers, the good news is that even if on that day I can’t convince the system to use my marble mouse at all, the system I can’t convince will be an actual Plan 9 system.
Probably.