Anti-Rat revolution: poisioning the rats

Keyboard_hacking Gaanu/Linux X11

2024-08-31


Scary what a rat can do to your workflow, it started off as a optional accessory but soon took over the computing scene. This is my journey of rehabilitation triggered by spilled milk on touchpad.

This workflow is also inspired by ratpoison window manager, when I popped on their IRC, I felt I found the tribe, finding the existence of people using links and a page #links2gang was a testement of that.

Although ratpoison has inbuilt functions/macros for rat clicks and movements, keeping it universal, mousemode and setxkbmap is what I used to achieve. I'm unsure of wayland but with X11 these should work without any tweaks on any window manager or desktop environment.

Disclaimer: Only physical rat is ditched not the X one, I feel it's impossible to do so! That teeny tiny nuisance no matter what window manager one uses, even the tiling ones. If one strictly wants to nuke the rat, then as far as I know, ditching entire X is the only option (Please enlighten me on this)

Who is this for?

ban_rats.png

Mousemode

Words of the developer, "mousemode is aimed at laptop power users that are annoyed with touchpads or people that in general find themselves in a position uncomfortable to be using the movie via conventional means"

One of the factor that got me was clean source, it's a single mousemode.c file and very readable for tweaking. I have written a comment on the package repo praising it. My current keybinding follows as, (taken from the source code)

#define FREQENCY 100
.
. 
.
    /*
     *     rouge-like    scroll       Speed      Quit
     *      y  k  u        o
     *       \ | /         |       (c) faster    Esc
     *    h --   -- l      |       (f) slower
     *       / | \         |
     *     b   j  n        i/e
     *
     *
     *     left, middle, right clicks
     *      a      s       d
     */
.
.
.
     while (running) {
         const struct timespec sleep_timespec = {0, 1e9 / FREQUENCY};
.
.

Here's a breakdown of above, current configuration uses a much higher speed for rat movement than the original source. That's what the frequency is for.

Secondly I thought I would abuse diagonal movements from nethack muscle memory but I found I'm efficient using hjkl alone to go anywhere thanks to bsd's tetris!, here's the video of it

my favourite of the bunch is selection!

Since I found I was using 'ctrl+w' for closing tabs in either browsers and terminal, using left hand I can only scroll down.

Regarding the speed, I never needed the key for making it faster further cause it's already! and using 'f' to slow down makes intuiatively sound.

Let me get out of mousemode with the same key press - ESC, but it's mapped to tapping caplocks once - homerow supremacy \o/

And finally the clicks with a, s, and d.

At the moment I'm on i3wm, so this mousemode is keybinded to mod+i as bindsym $mod+i mousemode. Ideally this should be enough to kill the rat but no especially the right clicks don't works as intended, my speculation is mousemode's click releases are fast enough to perfectly disguise. This brings us to conjuction with setxkbmap

setxkbmap

I'm reminding myself again, no one ever in *nix world has ever known the full features of X because it's not documented properly ever! This is the opt time to reveal some of the holy grails of cyberspace about X11

Tracing back to the topic, I have keypad on the laptop. I never found a use for it untill now. X11 has a inbuilt option to use keypad as rat movemention via pointerkeys. I stumbled this from a thread on unix.stackexchnage.com.

Temporarly one can test out with,

setxkbmap -option keypad:pointerkeys

By default, the key combo of Shift+numlock with turn numpad keyboard as rat! with '5' as click and all numbers corresponding to direction. To make this permananet I made configuration for X11

$ cat /etc/X11/xorg.conf.d/20-pointerkeys.conf
Section "InputClass"
    Identifier             "PointerKeys"
    MatchIsKeyboard        "yes"
    Option                 "XkbOptions" "keypad:pointerkeys"
EndSection

Again I haven't tinkered much with pointerkeys infact I never found what pointerkeys actually can/cannot do, but this is used as a extra dose of poison when I couldn't kill the rodent with mousemode clicks.

Edit 1.

A funny thing is just when I'm writing this, I found a guide that made me realize I can use left, middle, right clicks! First I have to select which click I want with / * - then pressing '5' will do that.

Although changing the clicks is not visible on screenkey, / * - corresponds to selecting buttons 1,2,3 on mouse but only after pressing 5, strokes get registered.

Pointerkeys/Mousekey seems to have a rich history, it suggests numpad were the goto way to operate that bloody rat, what a world we have evolved to.

That comes to an end. Reborn!

Edit 2.

Found a recent study on pointerkeys, titled Longitudinal Study of Two Virtual Cursors for People With Motor Impairments: A Performance and Satisfaction Analysis on Web Navigation - 10.1109/ACCESS.2020.3001766.

pointerkeys_cheatsheet.gif

Great Work and some day if any of my keyboard hack articles help people, I will feel accomplished \o/.

Evil forces

I was successful in killing all type of rats and rodents but there's surely one I'm not able! Whenever I see this, I'm tempted to ditch all and caress it. A Shameful realization, it's non other than trackpoint/nipple. The reason being I can still stay in home row and operate it, this is one of the well thought computing designs ever.

t430.png

This is my friend's T430 with a classic 7-row keyboard mod . I just cannot resist the urge, I find stupid reasons to borrow it for typing and scrolling through news/articles.

A reminder, Repetative Strain Injury (RSI) due to workflow is very serious so be cautious of it and as usual happy keyboard hacking ;)