Skip to content

EllaTheCat/dopamine-2022

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README.md

dopamine-2022 is dead

This repo is dead but cats have nine lives. Coming soon, the 5th attempt, made for Sway WM, developed on fedora 38 Sway spin so you can be using sway straght away in a ready-to-go lightweight DE without waiting for me.

dopamine-2022

4th in a series of git repositories brought to you by EllatheCat andl Parkinson's Disease, the chronic condition that just keeps on giving (kicks in the teeth).

dopamine-2022 instantly deprecates its predecessors. As of 2022-10-31 dopamine-2022 lets you operate a computer running the tiling window manager i3 (or possibly sway) without any of the keyboard modifiers {Mod5,Mod4,Mod3,Mod2,Mod1} whatsoever.

3rd Release by end Q2 2023

I spent 7 weeks in hospital 2022-12-21 to 2023-02-10 which gave me time to think. The outcome as of 2023-02-16 is a transition to the so-called 2nd release that changes the mode keys. Subsequently my computer was beset with multiple problems, including freezes and crashes. A new SSD for the system seems to have resurrected the machine, but now the milestone is a slip to the 3rd relaase. It is an opportunity to test!

Programming with Parkinson's

Inadvertent tremors or spasms cause typos. A typical typo might be the random insertion of the letters XS. This is caused by typing control-X control-S to save a file in emacs, hitting shift instead of control, and trying again because the save wasn't confirmed. Sometimes the XS lands inside a comment, no lasting harm done, but if it ends up in code nasty surprises can occur. XS and Q are hard to spot.

Medication induces drowsiness. I have woken after a split-second of narcolepsy with a keyboard dent in my forehead to see my work has been corrupted in spectacular fashion.

git for PD

git lets me recover my work after a.o. narcolepsy accidents.

git lets us share. This is fine until a project not unlike this one needs to adapt to several users, and then things get interesting. I've split the config to isolate those parts users will change to meet personal needs, such that they can avoid being overwritten by git.

Key to this is being able to include files inline at specified liine positions in a file, these are 'etc-includes', compare and contrast with i3 include directives.

Make for shellcheck

i3 runtime files have standard locations, In fact, a given file might have several standard locations ;) Putting files in the right places with the right permissions is called deployment.

A local git repo lives in a single directory under a toplevel directory. Deploying this program could be a simple matter of writing a script ; using the 'install' utiity would make it easier, it both copies and sets permissions. I chose to use 'make' instead.

Make is not popular with the cool kids in 2023, which is a shame. I think I'm competent enough to write a Makefile that other people can read and understand, that builds its targets correctly. Unfortunately etc-includes have complicated the Makefile considerably.

The Parkinsonian spanner-in-the-works

Cognitive decline deoesn't turn a developer into a slack-jawed yokel.

The sensation is that of "having something on the tip of your tongue"; you feel that you ought to know. I remember it well when I first noticed my inability to visualise gyroscopic precession during an interview. I wasn't expected to have the maths sklls, just be able to say "which way does it go when you push it here?".

As far as writing an i3 config that suits my workflow goes, cognitive decline means more stupid mistakes and misconceptions. Imposter syndrome writ large.

ShellCheck https://www.shellcheck.net/ is a utility for reporting how well a bash program follows "best practice" rules.

The Makefile won't let me deploy anything built with bash that hasn't been reviewed and approved by shellcheck. If anyone understands the principle, "i3configcheck" would be nice to have.

FEATURES

One Handed Operation

One-Handed Operation is facilitated by using i3 modes with bindings that don't require a modifier key.

Mode Select keys

After much contemplation the mode select keys are F1 through F10. They are fairly easy to reach, and they won't clash in ways they did before (hijacking grave and backslash).

The current defaults are that F1 enters main1 mode and F2 enters alias2 mode.

  1. The main (and aux) modes have functions bound to 1 character that are better suited to i3 window management, the WM modes.

  2. The alias modes have functions bound to 2 character strings that are better suited to shell commands, the DE modes.

$alias mode

From default mode, pressing a function key (let's assume F2) enters the command alias mode $alias2. Pressing space returns to default mode. Within $alias2 pressing a function key other than F2 (let's assume F9) enters the other's command alias mode, here $alias9.

Note: The F10 modes are $main0 $aux0 $alias0, not $main10, not $aux10, not $alias10.

The user presses three keys in succession to send a command. The first is the function key F, the second is any lowercase letter, the third is any lowercase letter or any digit. It is not necessary to press Enter.

THe sequence of three keys is transformed into an index into a lookup table, for example F10:g4 runs the command with that index, invoke by typing 'F10','g','4'.

Typing space as the second or third character returns to default mode immediately and cancels the command. The BMI shows the second character followed by dash prompting for the third, until you type the third, in our example 'g-'

Yes, you have 26 * 36 = 936 command aliases per function key. This apparent overkill permits sparse table with memorable commands; eg the four corners of a square mght be ne,se,sw,nw like the compass points.

main and aux mode

From default mode, pressing a function key (let's assume F5) enters the main mode $main5, another press enters the auxiliary mode $aux5. Further F5 presses toggle between $main5 and $aux5. Pressing space returs to default mode. Within $main5 or $aux5 pressing a function key other than F5 (let's assume F8) enters the other's main mode, here $main8.

Function Key modes

A file decides the type of mode a function key (let's use algebra and say F) shall enter when pressed in default mode, $alias or $main. The user can choose for each key in file fnkey_modes, but not at runtime.

Raw function keys at runtime

You can send raw function keys at runtime using two letter commands q1 ... q9 for F1 ... F9 and q0 qq qp for F10 F11 F12.

You can also send an escaped function key sequence of the form. "F11 F space". The closing space reveals that this is done quite elegantly by the F11 mode.

mode F11 { bindsym space mode default } bindsym F11 mode F11

Binding Mode Indicator

The i3bar shows the current binding mode in a dedicated tab next to the workspace tabs, with black text on a livid yellow background. The binding mode tab can also show some of the bound keys for the current mode.

Apropos of cognitive decline again, using the BMI to show bound keys even without aying what they are bound to helps considerably. Clustering also helps, compare "wasd hjkl" vs "adshjklw".

Editor Preferences

I use Emacs by default, so this document looks at Emacs in the context of i3 and my PD. I do use (neo)vi(m) for system admin and git commits.. I've eschewed some Emacs features in favour of ones that are usable with either editor. The best example is toggling between an editor window and a terminal running make rather than using M-x compile or whatever.

Emacs Inside

An instance of "Emacs inside" consists of xfce4-terminal with 3 tabs; the 1st tab is Emacs, the 2nd tab is a bash shell for running make and git; the 3rd tab is spare. The tabs can be selected by Alt + <;digit;>. My workflow is vulnerable to RSI whenever I use the mouse to switch between Emacs and terminal. Alt-1 and Alt-2 work really well instead.

Each instance of Emacs inside is tied to a workspace, and you can have up to 10 instances, e0,e1,..,e9. Each instance can be shown or hidden independent of the others. The show and hide transitions are animated, (I just hammer the system by redrawing the floating window rectangle at the appropriate sizes during the transition, this isn't Sway ;-)

Numbered Workspaces.

A two character string that matches ":isdigit: :isdigit:" (the numbers from 10 to 99) identifies a numbered workspace.

Command aliases

A two character string that matches ":islower: :islower:" or ":islower: :isdigit:" is called a "command alias" or a "named workspace", whichever seems appropriate. There are two types:

Applications with dedicated named workspaces

A command like 'thunderbird' or 'handbrake' has a command alias, 'tb' or 'hb' respectively, that focuses the running app, launches the app if not running beforehand, and (crucially) occupies over half of the screen such that the command alias 'xy' is synonymous with named workspace 'xy'. Emacs inside e0...e9 are in this category.

Applications without dedicated workspaces

There are command aliases 'pq' that do not have a dedicated named workspace workspace; they can have associated workspaces but it's not formalised.

These 'pq' are declared and defined in the $not_wsaapps dictionary inside cfg/apps00.

Using i3 with Parkinsons

Prompts

In addition to the Binding Mode Indicator prompts, there are prompts for the F2 command alias mode, obtained by typing "F2 z z". A dmenu at the bottom shows about 70 command aliases and the prompt "Esc to Quit, Return for help". Select an item from the list then type return and the list is replaced by a long line of help text for the chosen command alias, and the prompt says ""Esc to Quit, Return to invoke". Type Return and the command alias is invoked.

Lists

You want to move a workspace to an output. What if you know it's there but you can't see it? This might be the case when one of your two monitors is also a television and the workspace is on the monitor output? What if you have more outputs than screens? What if PD makes you appreciate any help you can get?

Typing "F2:w runs "move workspace to output interactive" which puts up a dmenu listing all workspaces grouped by output. Select an output and a workspace and the workspace moves to that output.

Summary

If I prevaricate as I have been doing this will never ship. I am therefore putting what I have up on github. I don't wish to offend, but the subtext of this project is two words:

NSFW Spoiler

"Fuck Parkinson's."

EllaTheCat

About

Use the i3 window manager single-handed should you have a movement disorder such as Parkinson's Disease which makes typing key chords difficult

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published