BREYDON’s

Typing Computers Better

Some kindly scripts and commands,
which have made it easier for me to use a laptop.

Contents

Technical Context

This record typically describes methods that I have successfully employed on a ThinkPad X200 Tablet (X200T), running Libreboot and Trisquel GNU/Linux 8.0 (Flidas).  You will probably find that many of these methods work with other, related kinds of equipment too.

For comparison:

The X200T --- manufactured in 2008 as a Lenovo ThinkPad; later refurbished and rebadged under various brands --- is a laptop computer.  It features a touchscreen, intended to work with both a purpose-designed stylus and direct bodily contact.  The lid of the laptop can be swivelled around, to rest closed with the screen facing outwards.

Although occasional pieces will be fairly specific to this model of computer, much of the information here relates to hardware generically!

Libreboot is firmware, derived from coreboot, for initialising and booting the computer system.

On my machine, Libreboot uses GRUB, a very common bootloader.

Trisquel is an operating system.  Trisquel’s 8th version, Flidas, is somewhat based upon Ubuntu 16.04 LTS (Xenial Xerus), which is itself built on Debian’s Sid trunk, circa Debian 9 (Stretch).  All of these are part of an enormous family of operating systems that behave in a more-or-less POSIX-friendly fashion.

Very roughly speaking, the closer the relationship between systems, the more that techniques borrowed across contexts will work without modification.

Personal Tendencies

I rely on an array of input methods, often in combination.  In order to employ these as needed, I switch frequently between emulated teletype consoles (TTYs) and graphical shells.

Graphical shells manifest as interfaces such as the venerable mixed-metaphor of a “desktop” plus “windows”, and the traditional smartphone app.  They typically listen out all the time for mouse or touch cues, over which I do not have reliable control.  The combination results in a fair bit of chaos, and loads of exhaustion.  So, I prefer to conserve my limited mousing and poking energies --- mainly for working in studios, or reaching resources over the web.  (Mind you, decent websites work fine in TTYs).

However, it is the graphical shell to which developers of accessibility aids for the paralysed have, predominantly, limited their endeavours.

In certain set-ups, too, touchscreen functionality can offer accessibility value --- although, in my case, only as a sporadically-used supplement; not as the main vector for engagement.

In a physical sense, I find that text-only interfaces are much easier to use than most graphical schemes.  In a TTY, there is seemingly infinitely less incorrect input to cause by accident.  Often I do things via the command line not because the tasks demand it, but for the gentler working environments that it can offer.  Still, typing can be very difficult for me.

Much of the time that my fingers are offline, my speech is pretty impaired.  Because of this, and my impression that it continues to demand a lot of computing power, I have not wandered into the world of speech-recognition.

Some Specific Tech

Stennie for Pretend Computer-Keyboard Input

Long have I eyed off the enormous accessibility potential that exists in the Open Steno Project, both generally and personally.  For the purposes of Typing Computers Better, let’s focus here on stenography for textual input to computers.

Being a keyboard-emulator, capable of sending keyboard-shortcuts, Plover facilitates stenographic control of desktop computing environments, as well as the writing and editing of text in them.

So far, I find Plover’s American steno approach to typing English substantially less physically demanding than most character-by-character technologies.  My musical background could play a tremendous role in how naturally the chording techniques come to me, so I suppose I ought not suggest that stenography is inherently better suited than serial typing to people with motor conditions like mine.  That said, much as a TTY-emulator presents the opportunity to correct a command before issuing it, Plover allows one to arrange a chord before stroking it (and to some extent, fill in ommissions before the stroke becomes finalised on release of the keys).  Meanwhile, the actual sequence of twitches, and constricted ranges of movement, both noticably diminish in consequence.  Stenography is not always the best technique for the job, but often does outshine available alternatives!

Over the years, Plover has gotten cleverer, more vesatile, available on more platforms, surrounded with a growing range of educational materials, and complemented by a variety of relatively low-cost keyboards, built by members of the open steno community.

There are three more major obstacles to sort out before I can see how stenography fares as a full-time thing, for myself.

  • Access to a personally appropriate keyboard set-up, for stenography.

    This is a little trial-and-errorsy.  Progress is a bit slow and pricey, away from any in-person steno community.  I definitely hope to share my findings in some useful way, for others starting out.  So far I have tried:

    • Using a specially designed layout on an ErgoDox keyboard:

      Doable, but bulky, and rough on the fingertips and their nearest knuckles; swapping keycaps around to improve ergonomics helped a lot (while mucking it up for other typing); installing larger keycaps would probably have similar effects; still not the healthiest long-term option.

    • Using the X200T’s in-built keyboard in Plover’s arppegiated mode:

      Pretty much operates in a manner more counter to my disabilities than its ready availability is worth, but may come in handy in the occasional pickle, particularly if consonants are remapped a row further up, which helps in angling the thumbs away from the space-bar.

    • A broken Georgi:

      The shape doesn't quite suit my hands, so I bump the thumb-operated number “bar” all the time (downward-bend-attempting thumb already curls towards number, then when in motion accelerates across the slippery surface of the adjacent vowel key; number key’s vertical offset coinicides with path of unstoppable oncoming thumb), and as not all of the main keys work, my vocabulary is substantially reduced.  Very exciting as a product, though; small, light, fairly limited cost.

  • Training myself thoroughly up in a steno theory — or at least expanding my repertoire beyond the tourist’s smattering I have acquired so far.

    I might need to rustle myself up some targetted word lists to drill from — especially given the incompatibility of complete Plover Theory with a broken keyboard.  I would like to write training software when I get the time, as existing options (though presumably great) are too internetty and demanding for modestly-powered computers.

  • The lack of (free) steno software for text-only and mobile platforms.

    I will learn to do it myself, if I have to.  This is so important that I have drawn myself up a graduated programming-project roadmap.

Anyhoo, stenno-mania is seeing me shift from frqnt bbrevtns in filenames, code, etc, to a preference for syllabically-built designators which read like normal words.

Emacs

I took up Emacs in my late twenties and remain cheerily novice-to-intermediate at even line-editing within it.  Its flexible structure appeals to me.  The means of issuing commands through M-x whole-words sits well with stenographic input.  Topping it off, Org mode is wild and brilliantly useful.  Lots of my computing goes on in Emacs (but only insofar as feels convenient).  You will occasionally notice it influencing my preferences, such as around email-doin’.

Shell Skills

Typing Computers Better assumes a patchy knowledge of digital computing --- particularly as it was most commonly practiced between the 1970s and 2010s.  For fluent reading, concepts such as computer files and booting should hold some vague meaning for you.  Some sections rely on more jargon than others.  After all, the top priority behind TCB is getting critical details jotted down (for myself).  I apologise for any confusing passages that result.  Improvements come with time, so feel free to return for smoother descriptions at later dates.

If you are playing along, we will be availing ourselves of the command line.  We both need to know

Here are some additional tips ---

Tracking Down Past Commands

Useful tricks at the command line can be awfully arcane.  But often, some tiny snippet is all it takes to retrieve a recently-used one, still listed in a shell history.

For example: grep "skerrick" ~/.bash_history in which grep does the searching, skerrick (or whatever you remember) does the getting-looked-for and ~/.bash_history (or wherever you need) does the being examined.

Even quicker checks are possible, such as from within fish, whose history eliminates duplicate listings and can be searched by typing the part you remember and, if necessary, using the up key to sift back in time.

“Do It Yourself, Computer” or Setting Up Scripts

We don’t need to enter tedious commands afresh every time that they are needed.  We can keep them somewhere convenient (like on the computer), for repeat use.  Doing this with shell commands gives us shell scripts.  The shell script is a similar idea to the script for a stageplay.  In this case, it is the computer who acts out the script.

Righto, How’s a Shell Script Look, Then?
#!/usr/bin/env sh

printf "Hello, I am a script."
sleep 1
printf " (I am still a script)."
sleep 2; printf " Goodbye."; sleep 1
exit 0
	      

A script --- stored as a file all of its own --- can be run by opening it like so: interpreter path/to/file.  For interpreter, put the command that will invoke a programme able to make sense of the script.  For shell scripts, this could be dash, fish, or something else available on your system.  So interpreter path/to/file might turn out like this: dash ~/gardening/veggies/seasonaladvisor.sh

This is a perfectly functional approach.  Great for ad hoc tricks.

Now, for scripts you will use on an ongoing basis?  It is still more faff (each time) than necessary.

Okay.  Make sure that the first line of the file your script is in reads something like:

#!/usr/bin/env sh
--- to clarify which interpreter should interpret it.

Next, (as a one-off) we can do the following:

Making a File Executable
chmod +x path/to/file

For example:

chmod +x something/snazzy.sh

Once that’s sorted, you will be able to start the script with a much simpler command: path/to/file  From within its own directory, that becomes ./file  Remember to include the ./ part (when you’re in there).

When you have a script that you really love to use, you can chuck it in the bin.  What??  By this I mean either: copying it to a place like ~/bin/ (cp path/to/file ~/bin/uniquecatchyname) or making a link, as with ln -s path/to/file ~/bin/uniquecatchyname

Easiest way to run your script now?  uniquecatchyname

bin Note

What is a place like ~/bin/?  It depends on how your system is set up.  Give ~/bin a go, though --- it is nice and easy to notice, play with, and back-up.

If you’ve not got it, you can make one, using mkdir ~/bin

If a script inside ~/bin does not run at the call of its uniquecatchyname, ensure that the file is executable.

If that doesn’t do the trick, you might need to add /home/your_username/bin to a thing called the $PATH.  As ever, the means depends on your specific system --- sorry!  Alternatively, try using ~/.local/bin as your bin.

Anyway, if any script stuff’s not convenient, never mind.  Back to business!

Nicening Up Our Interface

Portrait Modes and Upsidedowning

Sometimes a screen is more usable if it is turned sideways or upside-down.  Means of letting the software in on the rotation vary with context.

Changing (Framebuffered) TTY Orientation

Rotating All of the Emulated TTYs (for the Moment)
echo orientation | sudo tee /sys/class/graphics/fbcon/rotate_all

where orientation is an integer between 0 and 4 (inclusive)

Rotating Only the Emulated TTY in the Know (for the Moment)
echo orientation | sudo tee /sys/class/graphics/fbcon/rotate

where orientation is an integer between 0 and 4 (inclusive)

Choices of orientation with fbcon
To match a screen that is... Replace orientation with...
upright 0
turned on its right 1
upside-down 2
turned on its left 3
Setting Orientation Long-Term, with GRUB

Including the line GRUB_CMDLINE_LINUX="fbcon=rotate:orientation" in the file /etc/default/grub seems to set the system shell permanently to the given orientation.  This is assuming that one runs the command sudo update-grub before giving the machine a reboot, so that GRUB can implement the change.

And the Showy Shells?

Annoyingly, the X Window System and window managers acting thereunder seem to orient themselves independently of the /etc/default/grub-induced setting.  The tool turntab can coordinate X and virtual TTYs, although only for the current session of X.

Among the commands in turntab’s repertoire, is a broad one to turn X output.

Basic X11 Rotation with RandR
xrandr -o orientation

This time orientation is normal, left, inverted, or right.  Numbers work too, but RandR’s usage disagrees with the fbcon scheme!

Text Shell Colours

The multicoloured terminal draws on a basic palette of 16 colours.  These are typically intense, but can, in many cases, be made softer.  Let’s call the 16 spaces in that palette P0 through to PF (going into capital letters once we run out of single digits).  By default, these usually present something like this:

Traditional 16-Colour Terminal Palette
Palette Pozzie Kind of Colour For RGB Example, Hexadecimally
P0 Really dark black 000000
P1 Probational licensee red D00000
P2 Full-on lime green 00D000
P3 A trumpeting mustard D0D000
P4 A blue with conviction 0000D0
P5 A tough magenta D000D0
P6 A dependable cyan 00D0D0
P7 Such a light grey that it is an almost total white EEEEEE
P8 A mid-to-dark grey 555555
P9 Alarmist red FF0F0F
PA Highly contrived green 0FFF0F
PB A definite yellow FFFF0F
PC An F-off blue 0F0FFF
PD An exhaustive magenta FF0FFF
PE Exhausting cyan 0FFFFF
PF A searing white FFFFFF

These allow striking contrast.  Those programmes that do switch between display colours are not renowned for their sparing use of the facility.  I find most prove too clashy for sustained reading.  You might have difficulty with certain colours.  Perhaps you need a light background, reduced contrast, or to tone down the yellow.  Maybe you just really like mauve and would enjoy surveying an interface in a dozen variations on it plus a few complimentary exceptions.

Personalised Colour Schemes for TTY

Some user-specific tweaks can be declared by way of certain files.  Taking a squiz in the home folder of that specific user, we might find ~/.profile and bung into it a snatch of code like:

Babe!
echo -e '\e]P0ba00be'
clear
echo -e '\e]P100babe\e[31m...\e]P6baaabe\e]P7ace000\e[36m\t\v...Babe!\e[0m\n'
		

Wow! It’s a work of art.  (echo -e and \e are not so widely understood; so I would normally substitute printf and \033… but excuse me, this is poetry).

The main thing happening here is the palette colours are being reassigned, one at a time, using escape codes.  \e]Pn primes the shell to reassign palette position n.  The next six characters dictate the colour in terms of red, green and blue (using hexadecimal numbers between 00 and ff).  So, after receiving the escape code \e]P0ba00be, the next time the shell draws from Palette Pozzie P0, it busts out a fetching shade of ba00beP0 is traditionally the main background colour, so Babe!’s command clear --- redrawing the entire screen, almost entirely as background space --- gives a total ba00be base coat.  Both ba00be and subsequently assigned colours (like 00babe, baaabe and ace000) are called on using a reference system I can’t quite be bothered covering right now, but fractionally demonstrated here with \e[31m, \e[36m and the reset code \e[0m.

Upshot: we can blast in our individual preferences.  (Remembering that it is more versatile to use \033 and printf).

Nice Pragmatic Pastels for the Sensitive TTY
# BREYDON's Nice Pragmatic Pastels for the Sensitive TTY (posix editon)
# https://breydon.id.au/puting/tcb/
if [ "$TERM" = "linux" ]; then
  blackground=1a1a1a
  p_plate_red=e67373
  fullon_lime=abe673
  trumpeting_mustard=e6d073
  conviction_blue=73a5e6
  tough_magenta=d573e6
  dependable_cyan=a3cccc
  almost_total_white=cccccc
  grey=001020
  alarmist=e64845
  contrived=79cc29
  yellow=ccb814
  blue=4593e6
  exhaustive=cc14b8
  exhausting=7acccc
  searing=e6e6e6
  printf "\
\033]P0$blackground\033]P1$p_plate_red\
\033]P2$fullon_lime\033]P3$trumpeting_mustard\
\033]P4$conviction_blue\033]P5$tough_magenta\
\033]P6$dependable_cyan\033]P7$almost_total_white\
\033]P8$grey\033]P9$alarmist\033]PA$contrived\033]PB$yellow\
\033]PC$blue\033]PD$exhaustive\033]PE$exhausting\033]PF$searing"
fi
		

Character Size and Font Choices for TTY

I run a bit of…

A Debian Means to Set TTY Font
sudo dpkg-reconfigure console-setup

… now and then, to suit the nature of the work I’m swapping to; the positioning of my screen; and how my vision is doing, given these factors!

It takes 20–30 seconds to switch, because there is a bit of a wait at the end, after confirming the choices.

Sometimes it is easier to change the /etc/default/console-setup file directly, then instead run setupcon.  No big wait, this way.

My favourite font face (accessed through these methods) has been that named Fixed. I find it near to elegant, and appreciate its support of multiple systems of writing.  I mostly use Fixed at the sizes of 8x15 or 8x16.

Often, though, I use Terminus at 12x24 (because it’s a comfier size than is available in Fixed) or even 16x32Terminus’s 14x28 would make for a more practical option than the other sizes, except it comes out too fuzzy.

I suppose I could run the TTY at a lower screen resolution, to boost the visibility of Fixed?  I would still want to (temporarily) set the resolution higher on starting a graphical shell.  I have not experimented with TTY resolution yet.

Terminals’ Multilingualism

I wish there was broader support for linguistic diversity, in the console, on my system --- but sadly nah.  Maybe I need to install a different translation of the operating system itself??  Or find a cleverer font!

Comparative Trial of Command-Line Environments in a Japanese-Locale Trisquel System
Kernel Console Typical Emulator in Graphical Shell
A terminal display filled mostly by diamonds, representing characters unable to be shown. A terminal emulator actually displaying font-selection information in Japanese.
pretty and somewhat mysterious dry but revealing

No --- my only moderately successful trial of a Japanese installation, and incredulous manual-diving agree --- it is a question of using a more cosmopolitan console itself.

The problem with the standard TTY emulators lies in size limits on the available codesets.  Their absolute maximum is 512 symbols.  It’s 256 on FreeBSD or where one requires all sixteen colours --- rather than eight --- to be sent to truly text-only terminals (say to use certain complex, visually representational software).  Despite fonts such as Fixed coping with several systems of writing, you can’t cram that much language at once into such a teeny codeset.

For the record, what has been crammed is still a fair bit.  If the Console-setup User's Manual is to be believed, Fixed 8x16 supports all the console-setup codesets except Ethiopian --- those being Arabic (for Arabic, Kurdish, Pashto, Persian, and Urdu), Armenian, CyrAsia (for Chechen, Inupiaq, and many such-written languages), CyrKoi (for Russian and Ukrainian in KOI8-R or KOI8-U character-encodings), CyrSlav (for Belarusian, Bosnian in Latin characters, Bulgarian, Macedonian, Russian, Serbian in Cyrillic and Latin alphabets, and Ukrainian), Georgian, Greek, Hebrew (for Hebrew and Yiddish), Lao, Lat15, Lat2, Lat38, Lat7, Thai, Vietnamese (only in Latin characters, surprise-not), and the amalgams Uni1 (of most Latin, Slavic Cyrillic, and Hebrew, plus very limited Arabic), Uni2 (of most Latin, Slavic Cyrillic, and Greek) and Uni3 (of most Latin and most Cyrillic).  I haven’t confirmed whether the “Arabic”, “Greek” and “Hebrew” of the amalgamated sets refer to only the specific languages by those same names, but I would not be surprised either way.  The Ethiopian codeset has (incomplete) support in Fixed 8x15 and Fixed 8x18.  However, at 8x18 you lose coverage of the codesets Arabic and Lao.  At 8x15 Lao remains.

Disappointingly, Terminus doesn’t even (properly) cover the Arabic, Armenian, CyrAsia, Ethiopian, Georgian, Greek, Hebrew, Lao, Lat38, Thai, or Vietnamese codesets --- so the larger-print that Terminus offers is of extremely limited application.

Note that this concept of “codesets” differs from the choice of “character encoding”!  Even having opted for UTF-8 encoding, one cannot enjoy free range of a generous font; the codeset still needs to be swapped to match the content with which one is working (for that content to be displayed in the moment).

Some big accessibility problems here, even in the narrowest of disability-advocacy senses.  Ongoing need for the resetting of codesets is extremely inconvenient --- and hassle for the (en)abled is usually, for some portion of the population, inaccessibility by magnitude.  Then, most glaringly, there are a huge amount of people whose written languages are never displayed at all by the emulated TTY.  As someone who often can’t operate graphical software, I find this horrifying.  It’s not the 1980s anymore; there’s really no excuse to put artificial limitations on the linguistic communities a system can serve.  Insist on a minuscule early-ASCII-only terminal as an emergency backup measure?  Fine.  But it shouldn’t take a graphical interface or special, administrator knowledge to read everyday text.

Keymaps for Universal Basic Input

There are various ways of getting words and notation into a computer programme.  However, I’m not going that in-depth (nor in-breadth) on this page.  There is more info to come, in Personal Computing Favourites // Which You Might Like Computing With Too If You Dislike Computers Like I Do.  For now, let’s deal with the typical computer keyboard.  It is an important fall-back option --- even if the usual user(s) cannot operate one.

Surprisingly, my system claims to have no keymap for the ~virtual console~; only xkb keyboards --- or at least that’s what localectl and a quick survey of the standard directories say.  This feels disappointing, because loadkey’s keymap format speaks to me on a stylistic level.  Whereas xkb’s goes for a garbled blare.

I will probably at some point write my own old-fashioned keymap, but in the meantime… let’s take xkb for an improbably quick spin.

The Miracle of xkb

The philosophy informing xkb’s sense of keyboards is one of teetering variations whimsied together in fragile dependency, atop a foundation of staggering US-centrism even for the ****nix world and gratuitous assumptions about, for example, there being a tilde key, and What Women Want out of a capslock indicator.  To make even a tiny change to a keyboard lain hostage by this supposedly powerful/versatile/functional system, the poor end-user has to learn half the sprawly, scarcely-documented thing, and dive among multiple redundant system files feat. much the same information in disparate locations and formatting.

Are you (un)lucky enough to have stuff in a directory called /usr/share/X11/xkb/symbols/?  Then redundant system file #1 goes somewhere in there.  I have been using the English (UK, Dvorak) layout --- a.k.a gb(dvorak): a section of some endless other thing (the file gb).  This supposed layout, gb(dvorak), is in fact only six minor alterations to us(dvorak-alt-intl), of total other interminable blather usus(dvorak-alt-intl) itself is only eighteen-odd amendments to its fellow us-file resident, us(dvorak) --- which is confrontingly sparse, what with xkb’s separation of alphanumerics and state.

Suppose you wanted to turn one of your shift-keys into a frequent letter in your single-case writing system?  xbd scoffs at you, in cultural imperialism, and at your sensible dreams.  It doesn’t say you can’t do it, but certainly won’t imply that you can --- much less which time consuming approach(es) may or may not garner results.

Anyway, I want to rearrange the gb(dvorak) number row, to make more frequently-used punctuation less difficult to get at.  If xkb had its way, I’d write yet another set of changes in yet another symbols definition, that referred back to the unwieldy chain described above, and then sit back to watch the means of standard input cave in at a minor software update someday… and never quite be sure what my whole layout really was (structurally-speaking).

Nah, instead why not bundle their cumulative effects together in one piece, held somewhere easy to edit (sans root permish).  Suppose a file ~/compute/keymaps/xkb/symbols.  We can fling a faithful projection of it into cobwebbysystemspace with an early sudo ln -s ~/compute/keymaps/xkb/symbols /usr/share/X11/xkb/symbols/breydon, henceforth steering cheerfully clear of that particular muddle.  Sadly, xkb is many particular muddles, but we’ll deal with the rest strictly as needed.

A Custom xkb symbols File
// Garbage, based on chaotic combination
// that is xkd's gb(/us) dvorak default(s),
// only with some of the self-defeating
// conflicts amended and number-row differing

partial alphanumeric_keys modifier_keys
xkb_symbols "flimsy-dvorak" {

    name[Group1]= "Breydon (Flimsy Dvorak)";

    key <TLDE> { [ braceleft,       bracketleft                                  ] };
    key <AE01> { [ ampersand,       7                                            ] };
    key <AE02> { [ percent,         5                                            ] };
    key <AE03> { [ sterling,        3,          threesuperior,  threesuperior    ] };
    key <AE04> { [ exclam,          1                                            ] };
    key <AE05> { [ parenleft,       9                                            ] };
    key <AE06> { [ parenright,      0                                            ] };
    key <AE07> { [ quotedbl,        2,          dead_diaeresis, twosuperior      ] };
    key <AE08> { [ dollar,          4,          EuroSign                         ] };
    key <AE09> { [ dead_circumflex, 6,          asciicircum,    dead_circumflex  ] };
    key <AE10> { [ asterisk,        8                                            ] };
    key <AE11> { [ braceright,      bracketright                                 ] };
    key <AE12> { [ grave,           notsign,    dead_grave,     bar              ] };

    key <AD01> { [ apostrophe,      at,         dead_acute                       ] };
    key <AD02> { [ comma,           less,       adiaeresis,     dead_caron       ] };
    key <AD03> { [ period,          greater,    ecircumflex,    periodcentered   ] };
    key <AD04> { [ p,               P,          ediaeresis,     dead_cedilla     ] };
    key <AD05> { [ y,               Y,          udiaeresis                       ] };
    key <AD06> { [ f,               F                                            ] };
    key <AD07> { [ g,               G                                            ] };
    key <AD08> { [ c,               C,          ccedilla,       dead_abovedot    ] };
    key <AD09> { [ r,               R                                            ] };
    key <AD10> { [ l,               L                                            ] };
    key <AD11> { [ slash,           question                                     ] };
    key <AD12> { [ equal,           plus                                         ] };

    key <CAPS> { [ U1F49B,         U1F60A,     U1F914,         U1F609            ] };
    key <AC01> { [ a,               A,          agrave                           ] };
    key <AC02> { [ o,               O,          ocircumflex                      ] };
    key <AC03> { [ e,               E,          eacute                           ] };
    key <AC04> { [ u,               U,          ucircumflex                      ] };
    key <AC05> { [ i,               I,          icircumflex                      ] };
    key <AC06> { [ d,               D                                            ] };
    key <AC07> { [ h,               H                                            ] };
    key <AC08> { [ t,               T                                            ] };
    key <AC09> { [ n,               N                                            ] };
    key <AC10> { [ s,               S,          ssharp                           ] };
    key <AC11> { [ minus,           underscore                                   ] };
    key <BKSL> { [ numbersign,      asciitilde, dead_tilde                       ] };

    key <LSGT> { [ backslash,       bar                                          ] };
    key <AB01> { [ semicolon,       colon,      acircumflex                      ] };
    key <AB02> { [ q,               Q,          odiaeresis,     dead_ogonek      ] };
    key <AB03> { [ j,               J,          egrave,         dead_doubleacute ] };
    key <AB04> { [ k,               K,          ugrave                           ] };
    key <AB05> { [ x,               X,          idiaeresis                       ] };
    key <AB06> { [ b,               B                                            ] };
    key <AB07> { [ m,               M                                            ] };
    key <AB08> { [ w,               W                                            ] };
    key <AB09> { [ v,               V                                            ] };
    key <AB10> { [ z,               Z                                            ] };

    include "level3(ralt_switch)"
    # (P.S. include "level3(ralt_switch)" is yet more meandering dependency).
    #                                      (Sorry. I'll deal with it later,)
    #                                                               (maybe?)
};

Ugh.

You might think this ought to be enough, for clever, modern, sophisticated keymapping software (’cause to be honest: much as I moan, xkb is in some ways quite snazzy).  Maybe we nudge some sweet little Richard Scarry mouse to reshelve the database a little earlier than its next routine rounds?

Apparently not.  Besides, there’s actually more metadata to tack on yet.

Be the Industrious Urbanised Critter You Wish to See in the World
<layout>
  <configItem>
    <name>breydon</name>

    <shortDescription>flimsy-dvorak</shortDescription>
    <description>Breydon (Flimsy Dvorak)</description>
    <countryList>
      <iso3166Id>AU</iso3166Id>
    </countryList>
    <languageList>
      <iso639Id>eng</iso639Id>
    </languageList>
  </configItem>
  <variantList>
    <variant>
      <configItem>
        <name>flimsier-dvorak-emoji</name>
        <description>Breydon (Dvorak but applied to Emoji)</description>
      </configItem>
    </variant>
  </variantList>
</layout>
		  
Key:
breydon
the name of the shortcut already plonked into /usr/share/X11/xkb/symbols, to lead to the custom symbols file
flimsy-dvorak
the default variation, named by the custom symbols file’s line:
xkb_symbols "flimsy-dvorak" {
AU and/or whatever else
(1 country code per pair of tags)
country/ies for this layout to get listed under
eng and/or whatever else
(1 language code per pair of tags)
language(s) for this layout to get listed under
<variantList></variantList>
(if your custom symbols file defines multiple layouts)
remaining <variant></variant> listings, each containing another <configItem></configItem>, formatted as shown

Run sudo editor /usr/share/X11/xkb/rules/evdev.xml (for your text-editor of choice), slip your lovely hunk of xml in somewhere unobtrusive between the <layoutList> tags, then save, and exit.

Cool, so all going modernly (as of, I dunno, 2010s?), the custom layout now appears in the fundamental Keyboard configuration utility of like, graphical-desktoppy whatsoes.  Maybe even o’ undesktoppy graphical whosettes like Sugar.  You shouuuuuld be able to summon your new layout manually, in /etc/default/keyboard, too!  (For X, at least).

But not thingers like iBus, ye olde sudo dpkg-reconfigure keyboard-configuration, and probably the 97 other mutually-sabotaging methods of doing the same thing that get prewrapped in the one OS distro.  These boldly rewrite one’s /etc/default/keyboard in sheer confusion (even when they say they won’t), or pay it either no or far too much mind to begin with.

(A(nother)) Thing is, some of system instead claims to want /usr/share/X11/xkb/rules/xorg.lst (currently a link to /usr/share/X11/xkb/rules/base.lst, which is identical to /usr/share/X11/xkb/rules/evdev.lst, and not to be confused with the .xml renditions of the same general idea, and did I mention this whole arrangement is a mess).  But those do not seem to actually do the trick(s) either, so.

How About Friendly Keyboard Input Method System X?

I only suggest using further shambles such as iBus if you need it for tools like Anthy.  ’Course if you do, the very selection (at xkb-level) of a layout as-yet-unknown to iBus can stop the latter from functioning.  (Which sucks not least because hardly any keyboard layouts have been pre-included in iBus --- so you might need to do the following even for a non-custom layout).

Gettin’ an xkb Layout into iBus
<engine>
  <name>xkb:breydon:flimsy-dvorak:eng</name>
  <language>eng</language>
  <license>public domain as possible</license>

  <author>Kermie Breydon &lt;https://www.breydon.id.au/puting/tcb/&gt;</author>
  <layout>breydon</layout>
  <layout_variant>flimsy-dvorak</layout_variant>

  <longname>Breydon (Flimsy Dvorak)</longname>
  <description>🤔</description>
  <icon>ibus-keyboard</icon>
  <rank>1</rank>
</engine>
		  

Run sudo editor /usr/share/ibus/component/simple.xml (for your preferred editor), add your wild guess between the <engines>…</engines> tags, save, exit, run ibus restart, and (if needed, you poor darling) reconstruct your delicate iBus balance anew.  May still have to toggle the Use system keyboard layout option until something behaves.

etc, etc, yikes; no further reading, no further questions, Your Honour.

Taking Advantage of the Tablet Hardware

Bezel Buttons

The X200T sports some extra buttons just beside the screen.  These are great for initiating commands that otherwise demand a lot of fiddliness.

I imagine that one could make the buttons spit out macros from all sorts of interfaces within the same system, by setting this up at the keymap level.  So far, I have only configured their use, as shortcut keys, in one of the (graphical) shells I use.

Under MATE Desktop

Note: Names within this section are quoted from the English (Australia) translation of MATE 1.12.1.  In many other versions, the same functions will be identified differently.

MATE has a Control Centre module named Keyboard Shortcuts, for “Assign[ing] shortcut keys to commands”.  It lists about 80 suggested actions (many of them already preset with shortcuts), under various category headings.  There is also a Custom Shortcuts heading, for any additional commands that one specifies.

It is not the least treacherous interface that may be conceived for the job.  Still, we try and push on.

Editing a Command in MATE’s Keyboard Shortcuts
Two rather chaotic dialogue boxes, assigning the command 'turntab x input' to a button which is identified as 'XF86RotateWindows'.
The process

My most conventional example actually involves another extra button, on a different part of the computer.  Of all the controls built into the machine --- aside from tapping return, closing the lid, or depressing the space bar --- this button is the easiest for me to operate.

It is at the far edge of the keyboard, next to some volume controls, near the Esc key.  It is a different shape to the other keys or buttons, and a metallic blue colour.  A label just above it reads “ThinkVantage”.  Keyboard Shortcuts (and related xkb-reliant software) represents this button as XF86Launch1.

I set XF86Launch1 to start a terminal emulator.  That way, the easiest spare control (in laptop mode) triggers the most versatile tool (for that context).  The most versatile tool to some folks might be something else, like voice-recognition software.  Maybe closing the lid (screen-out) best open a communication board… full-screen… in portrait orientation.  Sadly, recognising a close of the lid might take a more sophisticated utility than Keyboard Shortcuts; however, the rest is well within its means.

In Keyboard Shortcuts, choosing Add prepares a something to go giving a shortcut.  The programme requests a Name (eg, Open Terminal) to describe the action that the shortcut will trigger, as well as the precise Command to run in order to realise that action (such as the application mate-terminal).  Choosing Apply pops this new action into the list, using the name you just gave it.

Then one must click (bonkers) the very same listing (ridiculous) that only just got only half-minted (come on), but the clicking must fall within the domain of the Shortcut --- not the much larger, substantially less difficult-to-click Action --- column (really?), which then if you even manage glibly relists itself as using a New shortcut....  It’s actually listening out for a demonstration of the new shortcut; so, press your preferred key(s) and hope for the best.  Best case scenario is in fa--BOOM, DONE --- but with zero request for confirmation and in reality minimal feedback.  Therefore, moderate case scenario: accidentally remap loads of vital shortcuts without even realising.  Cool, love it.

Summoning a Menu

’Cos, yeah, you change shortcuts in the same way.  (Against all odds).

The Desktop category contains an item called Show the panel's main menu.  I assigned this command one of the special buttons.  For some reason, this particular button is not named in the Keyboard Shortcuts display.  Nevertheless, it works.

When the button is pressed, a menu (unless one is already open) sprouts from the tip of the mouse-pointer.  Had I a MATE Main Menu or MATE Menu Bar already lurking, collapsed, on a panel somewhere, it seems the menu-unfurling would disregard the position of the pointer.  But --- particularly when relying on the touchscreen --- the menu is more use in a central location.

Thanks to this shortcut, I bypass the usual dependency on awkward onscreen edge-panels, to explore (or leave!) the desktop environment, without having to know (or type) the underlying application names.

Launch, like, Tor Browser or whatever

So what are we dooooooooooing in an inaccessible virtual environment anyway?  Possibly tackling tasks that require it.  Here’s a special case: Tor Browser.  Doesn’t make itself at home in said inaccessible virtual environment.  Has this whole mechanism that doesn’t (automatically) show up in typical app launcher-launched app fashion.  Want a keyboard shortcut anyway?

Command (to which to assign the shortcut) goes something like this:

Kitten-Soft Underbelly of TorB Shorties
sh -c '"/beginning/of/filepath/Browser/start-tor-browser" --detach || ([ ! -x "/beginning/of/filepath/Browser/start-tor-browser" ] && "$(dirname "$*")"/Browser/start-tor-browser --detach)' dummy %k

The /beginning/of/filepath/ parts depend on the, y’know, actual filepath, and should be corrected accordingly.

That’s what the stock double-clicky desktop iconny thingo performs, anyway…

  1. sh cries out for a shell;
  2. -c urges sh or whatever is pretending to be it to take its parameters from the command string operand
  3. "/beginning/of/filepath/Browser/start-tor-browser" is a bit of a take this puppy, blahblahblah, for a run
  4. || is all, so if not so flash the bit just gone try the bit after (or “or”)
  5. [ ! -x "/beginning/of/filepath/Browser/start-tor-browser" ] is like, be it not true that blahblahblah exists and can be talked into running, or something
  6. && is hyperactive kitten for yes but if so, that it does be not true that blahblahblah etc, then also please (or “and”)
  7. "$(dirname "$*")" is, like, convoluted for (can you) guess where I’m calling from, or --- in most cases --- dot (rarely the Las Vegas Hilton)
  8. "$(dirname "$*")"/Browser/start-tor-browser, then, is from here (my here, as opposed to your here there or our yonder) hook a /Browser and then chuck another / and then swing a start-tor-browser
  9. each --detach is a tell them to go on without you
  10. meaning '"/beginning/of/filepath/Browser/start-tor-browser" --detach || ([ ! -x "/beginning/of/filepath/Browser/start-tor-browser" ] && "$(dirname "$*")"/Browser/start-tor-browser --detach)' gives us (or, rather, gives sh or one of several other possible shells in a trenchcoat) unleash the hounds! (of thereabouts or, failing that, hereabouts)
  11. anyhoo, there’s your command name (or 1st, no wait, sorry, 0th parameter) plus its 1st positional parameter for sh or whomever, now here’s Wonderwall...

… you know what, we’ll be here all week at this rate.  Don’t take my word for it, anyway.

Mind you, if you do take my word, well --- my word, command only need go something like that.

Something Like the Kitten-Soft Underbelly of TorB Shorties
/beginning/of/filepath/Browser/start-tor-browser

Again, the /beginning/of/filepath/ part should be corrected to suit the actual filepath.

This I inferred while perusing start-tor-browser itself, which is but a humble shell script (and an interesting read, as far as these things go).  Other gleanings include just what --detach thinks it is doing young man.

Touchscreeniness

Rotate Input

One of the special screen-side buttons on the X200T is specifically meant to allow things to seem upright(ish) no which way around the machine is situated.  Miraculously, when MATE is active, the display responds to this button --- without any further configuration --- by rotating 90 degrees counterclockwise for every press, as intended.  The input aspect of the screen, however, does not.

Some kind soul on the Internet once published scripts to deal with this sort of problem.  However, they only dealt with stylus input (and only one of two applicable kinds, at that).  My computer was missing its stylus, when I got it, and ever since.  (If anyone has a compatable sparey to give away, I would love a stylus!  The use of a stylus was a large factor in my going for the tabletty X200!)  I dug around and revised the script to cover alternative touch input (from fingernails and such).  Hooray!

My touch script goes into MATE’s Keyboard Shortcuts as an action, named Correct Tablet Orientation, consisting of the command sh "/home/username/compute/touchfix.sh" --- where username is my username, ~/compute is the directory I keep the script in, and touchfix.sh is the name of the script.

turntab

After many months of happy use, I overhauled my modified script, and then wrote one afresh (in the hopes of improved portability).  You are welcome to the outcome: turntab.  Comments in the source there talk you through it.  Just note that due to turntab being much more powerful, for the same Correct Tablet Orientation effect it must be called with the command suffixes x and input.

Vocal Sythesis

nevr

While tweaking espeak, I whipped up a script to help adjust the default voice more swiftly.  It’s now up for download, as nevr (short for noodly espeak voice-replacement).

It’s really just an overblown way of avoiding three arduous lines.

Replacing the default espeak voice
espeak --ipa 'First I tend to speak like this.'
sudo cp replacement-voice $(espeak --version | sed -E  's/.*Data at: //')/voices/default
espeak --ipa 'Now I will tend to speak like this.'

Replace replacement-voice with the correct path for your one.

Best check there is an espeak (and back up its original default) before running wild with this.

Much more enjoyable to go nevr noodle.

Managing Messages

Doing E-mails (in the Britney Spears sense)

Doing emails depends on complicated systems.  Dipping into console-emailing tends to expose that complexity.

Alpine is relatively kind.

However, a more modular approach may be desirable.  Here are some alternatives, for specific tasks.

For retrieving emails, consider a tool whose stash of messages remains available when the internet is not.  Before you get overwhelmed with compatibility issues: the defining convention of the early 21st century has been to synchronise IMAP (at your mail-provider’s end) and Maildir (on your machine).  Tools for this include the simplistic OfflineIMAP; as well mbsync and fetchmail-with-procmail (which might be more robust).  There are of course ways other than IMAP to get emails, and systems to store them other than Maildir, but most of the following material assumes their use.

Indexing and searching mail, I am inclined towards Notmuch or mu.  These both integrate well with Emacs, thanks to the Notmuch Emacs interface and mu4emu(4e) has the more helpful instructions.

For softness, consider Mew.  Though it’s a different beast, it has even clearer instructions.

Mailing out them emails?  SMTP via Emacssmtpmail[-multi]?  nullmailer?  Who knows?

Stashing Email with OfflineIMAP

Sadly, OfflineIMAP is not really for me --- but gee is it easy to set up.  Gecher extrapolation-hat on…

Simple Multiaccount ~/.offlineimaprc
[general]
accounts = iceskating, soupkitchen


[Account iceskating]
localrepository = iceskatinglocal
remoterepository = iceskatingremote
# postsynchook = mu index --maildir=~/maildir
# autorefresh = 480
# quick = 10

[Repository iceskatinglocal]
type = Maildir
localfolders = ~/maildir/iceskating

[Repository iceskatingremote]
type = IMAP
remotehost = imap.host-of-iceskating-account.net
remoteuser = iceskating_username
ssl = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
# maxconnections = 2


[Account soupkitchen]
localrepository = soupkitchenlocal
remoterepository = soupkitchenremote
# postsynchook = mu index --maildir=~/maildir
# autorefresh = 30
# quick = 3
# status_backend = sqlite

[Repository soupkitchenlocal]
type = Maildir
localfolders = ~/maildir/soupkitchen

[Repository soupkitchenremote]
type = IMAP
remotehost = mail.host-of-soupkitchen-account.org
remoteuser = soupkitchen_login
ssl = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
# maxconnections = 3
		

Nifty but nonessential settings have been commented out with a hash sign: #.

Note that changing the status_backend may require a certain procedure, rather than simply removing the #-symbol!

Passphrases are a bit trickier to automate, for the early dabbler.  Rather than worry about storing them safely, I prefer to enter those as needed.

Sorting Email with Notmuch

My file-management sensiblities are old-fashioned: I love thoughtful structuring of directories, and savour the sense of release in deleting things that are no-longer (or indeed never) needed.  Notmuch’s placelessness and indiscriminate retention feels wobbly and greedy.  Nonetheless, its modern approach lends Notmuch an appealing flexibility.

(It’s not like a bung database would render m’emails more inaccessible than they are through a GUI, anyway!)

Lessening Still

To crib from the official advice on true deleting

  1. optional (in)convenience: add keybinding for goner tag
  2. optional convenience: have goners be hidden hence unless asked for, thanks to notmuch config set search.exclude_tags goner

  3. use tag to dismiss pieces of mail
  4. have the actual deleting done with notmuch search --output=files tag:goner | xargs -l rm

Email convention may be to label goners as deleted, but to do so is rather confusing.  Either way, I have not figured out quite what is meant to go on.

I have experimented with using a deleted tag (as the documentation suggests), on the assumption that Notmuch might explain the deletedness to the local maildir and thus on to IMAP, as it appears to about unread taggèdness.  And I have tried a tag worded as makes far more sense to me: goner.  The decisive detail seems to be the actual deleting on the filesystem.

Afterwards, updating the Notmuch database (by way of notmuch new) can confirm goneness; later, resynching the stash of mail encourages spread of the goneness to other machines — tada, a surprisingly functioning workflow.

Note: Despite general deleting success, I have witnessed the maildir derived from one particular email account not play along.  Remains to have the bother directed at it to find out why.

Taking Advantage of Saved Searches
A Snapshot of My Saved Searches — Several Hundred Threads into Sifting a Few Thou Messages with Notmuch
(custom-set-variables
 ;; may be preceded by unrelated things
 '(notmuch-saved-searches
   (quote
    ((:name "inbox" :query "tag:inbox")
     (:name "unread" :query "tag:unread" :key "u")
     (:name "flagged" :query "tag:flagged" :key "l")
     (:name "freshhh" :query "date:3hours..now and tag:inbox" :key "h")
     (:name "today" :query "date:today..! and tag:inbox" :key "t")
     (:name "tofortnight" :query "date:2weeks..yesterday and tag:inbox" :key "14")
     (:name "awaiting---resolved?" :query "tag:awaiting-arrival or tag:awaiting-fix" :key "a")
     (:name "write-back!" :query "tag:write-back" :key "w")
     (:name "chase-up!" :query "tag:chase-up" :key "c")
     (:name "check!" :query "tag:check-bank-statement" :key "k")
     (:name "file!" :query "tag:file-attachment" :key "f")
     (:name "invoice!" :query "tag:do-invoice" :key "i")
     (:name "record!" :query "tag:record!" :key "r")
     (:name "unsubscribe!" :query "tag:unsubscribe")
     (:name "goners" :query "tag:goner")
     (:name "drafts" :query "tag:draft" :key "d"))))
 ;; may be followed by unrelated things
)
		  

This goes in one’s Emacs init file.  Emacs can take care of that for you, if you prefer to use Notmuch mode’s Saved searches: [edit] form.  The settings are less tiring to change directly in the init, but.

A Contemporary notmuch-hello Screen Powered by Those Saved Searches
   Welcome to notmuch. You have 2 299 messages.

Saved searches: [edit]

       1 627 inbox                           2 chase-up!
	 654 unread                         10 check!
	 117 flagged                         3 unsubscribe!
	  24 tofortnight                    85 goners
	  19 awaiting---resolved?           20 drafts

Search:                                                              .

All tags: [show]

      Type a search query and hit RET to view matching threads.
	     Edit saved searches with the `edit' button.
Hit RET or click on a saved search or tag name to view matching threads.
  `=' to refresh this screen. `s' to search messages. `q' to quit.
			Customize this page.

Note how only those searches which returned results form items in Notmuch’s Saved searches summary.

References, Further Reading, and Whatnot

An overwhelming proportion of this page is based on direct observation of the tools themselves.  I have not yet bothered to cite many works of technology --- such as pieces of software --- in detail.  Their names alone will usually be sufficient to track down those still in common use.  My apologies for any trickier cases.  Let me know if you do need a hand identifying any of the tools that I have mentioned.

I am gradually adding additional references, below.  There are some flagrantly technical documents, for those who would prefer to poke around with respect to published conventions.  There are holders of crucial detail largely lost on the prevailing literature.  Best of all --- there is the odd marvellous guide.  Happy exploring!

Technical Context

Shell Skills

Nicening Up Our Interface

Character Size and Font Choices for TTY

  • Console-setup User's Manual, on-line reference manual page console-setup(5), 11 March 2011.

Managing Messages

  • GNUnet Reference Manual version 0.13.3.  GNUnet e.V., circa 2019.  (archived webpage)
    By reconstructing the internet, for the better.
    Honestly, the GNU brand gives me the heebie-jeebies.  Surely there is further writing, out there, on this subject?  These are vital conversations!
  • Pocock, DanielReal-Time Communications Quick Start Guide.  2015.  (archived startpage/archived pdf)
    Methods which are more established.

Doing E-mails (in the Britney Spears sense)

These decades, hosting one’s own email might be beyond the expected scope of a gentle, general journal like Typing Computers Better.  Frankly, it is closely related.  Arguably, it is simpler than merely accessing one’s eem.  I may have lost my old links to trusty tutorials, but don’t you give up!